Rockbox Technical Forums

Rockbox Development => Feature Ideas => Topic started by: RubenK on October 13, 2008, 10:41:27 AM

Title: Convert folder.jpg to cover.bmp
Post by: RubenK on October 13, 2008, 10:41:27 AM
Well, we all know the problem... You always find those folder.jpg files but rockbox hates those, so you have to convert them to a cover.bmp file. Sure, there are script already made for that, but even that's to much work if you ask me. Why not integrate it into rockbox itself. How hard can it be to have a something covert some folder.jpg's to cover.bmp's?
I'm no programmer and I couldn't find any topics relating to this issue. Please forgive me if I did or said something stupid :P
At least I just want to say that I enjoy using Rockbox very much and it made my sansa e200, which was a very good buy, an even better one. Keep up the good work!!!
Title: Re: Convert folder.jpg to cover.bmp
Post by: Llorean on October 13, 2008, 10:49:20 AM
Your computer is many hundred times the speed of your MP3 player.

If it takes 5 minutes to convert all the files on your computer, it could take half a day on your MP3 player.
Title: Re: Convert folder.jpg to cover.bmp
Post by: RubenK on October 13, 2008, 11:12:24 AM
Yeah, sure, I get that. But how much would memory would it take? 10 kb max? That should be possible right? It can show HD images on high res; 120×120 bitmap files should be a piece of cake or is there something that I'm missing? It's like refreshing the database, only it will take just that little more time. Off course it then should be optional so people who want to have a quick start-up are happy folks as well. :P
Let me know what you think  ;)
Title: Re: Convert folder.jpg to cover.bmp
Post by: Llorean on October 13, 2008, 11:38:15 AM
So you're saying you'd rather sit your MP3 player on a desk for half a day (12 hours) waiting for it to convert images than just run a script on your computer once for five minutes?
Title: Re: Convert folder.jpg to cover.bmp
Post by: RubenK on October 13, 2008, 12:36:38 PM
I was kind of interpreting that the numbers you were saying were exaggerated... :P Will converting 10 to 20 jpg files of no more than 10 kb a piece to bmp really take half a day? If so, I ask you how it's able to show video's, play music while playing games aswell, display a 4000×4000 detailed image, etc, etc.
Title: Re: Convert folder.jpg to cover.bmp
Post by: Llorean on October 13, 2008, 12:41:33 PM
You mentioned converting your whole collection, like the scripts on the PC, not simply displaying jpegs. What good is converting 10 or 20 when most peoples' collections have hundreds of albums?
Title: Re: Convert folder.jpg to cover.bmp
Post by: RubenK on October 13, 2008, 12:57:28 PM
My whole collection won't fit on my sansa. ;)
Ok maybe I should be more specific...
The thing I'm suggesting is:
 - You put a folder (album) on your sansa (or other mp3-player)
 - If Rockbox finds a folder.jpg file in that new folder (if any), it converts it to a cover.bmp file.
 - When the complete folder is removed, nothing happens, the files are just gone.
 - When a new folder is added to the drive, Rockbox finds the folder.jpg file and converts it to the required cover.bmp (like refreshing the database when new songs are added)
So, to summarize: a folder with a folder.jpg is added to the drive, Rockbox converts it into the required cover.bmp.
This way, Rockbox has to do that, say max. 10 to 20 times in a row? Does this realy take up that much memory?

>EDIT< You could convert all of them using a script, but in linux it's difficult (I can't figure out how...) This is just an easy and user friendly solution imo.
Title: Re: Convert folder.jpg to cover.bmp
Post by: shotofadds on October 13, 2008, 02:22:58 PM
I think it's a pretty reasonable request (and something I'd probably use from time to time). It should be pretty straightforward* to implement as a plugin, although the JPEG decoding code would first need to be moved from the current JPEG viewer plugin into the plugin lib.

If an "album art resize" plugin were written, it could either run as a standalone plugin (processing the whole filesystem?) or as a 'viewer' for individual directories. Just make sure it has a progress display and an EXIT button...

*Having just had a peek at jpeg.c I'll back away from attempting this for the time being. It looks like it'd soak up far too much time that I should be spending on other things.

Your computer is many hundred times the speed of your MP3 player
That's maybe just a slight exaggeration... ;)
Title: Re: Convert folder.jpg to cover.bmp
Post by: RubenK on October 13, 2008, 02:44:15 PM
I thank you for looking at it. I understand the time off the people working on Rockbox should be spend as well as possible. If I had any experience I would try it myself, but this is far out of my league. Perhaps someone else who has some time on there hands can do this? I thank you for taking time to see what you can do, I know you guys are always busy (mainly because of people like me! :D)
Title: Re: Convert folder.jpg to cover.bmp
Post by: Llorean on October 13, 2008, 03:18:42 PM
Quote
That's maybe just a slight exaggeration... ;)
I wouldn't necessarily say so. While the flat MHZ difference isn't a hundredfold multiplication, desktop CPUs have many advantages that would allow them to decode JPEG vastly vaster than these players could. It may not be hundreds, but the difference is significant enough that it would take many, many times longer than a database refresh takes.
Title: Re: Convert folder.jpg to cover.bmp
Post by: saratoga on October 13, 2008, 03:32:43 PM
It would make more sense to add for support for jpeg album art then to add support for converting jpegs to bmps. 
Title: Re: Convert folder.jpg to cover.bmp
Post by: Llorean on October 13, 2008, 03:35:51 PM
Yep, but that's already a feature we openly admit we want as long as it's done well.
Title: Re: Convert folder.jpg to cover.bmp
Post by: nls on October 14, 2008, 03:00:48 AM
It would make more sense to add for support for jpeg album art then to add support for converting jpegs to bmps. 

I agree, and adding half measure workarounds never helped getting the real solution done...
Title: Re: Convert folder.jpg to cover.bmp
Post by: RubenK on October 14, 2008, 04:56:20 PM
So how difficult is it to do this? Could the jpg stuff be subtracted of the original firmware? Again, I don't no cr*p about programming, I just throw some ideas in. What's the main difference the developers chose for .bmp's over jpg's anyway?
Title: Re: Convert folder.jpg to cover.bmp
Post by: saratoga on October 14, 2008, 05:03:05 PM
So how difficult is it to do this?

Not very.

Could the jpg stuff be subtracted of the original firmware?

No thats not legal and also stupidly difficult to do.

Again, I don't no cr*p about programming, I just throw some ideas in.

Throwing out ideas when you don't know what you're talking about is rarely a good idea.

What's the main difference the developers chose for .bmp's over jpg's anyway?

We didn't have a JPG decoder in the core.
Title: Re: Convert folder.jpg to cover.bmp
Post by: RubenK on October 14, 2008, 06:05:53 PM
Very well then, I will let you guys figure out a way to support .jpg files as album arts. I've did my part, we'll see where that will bring us.
I will follow the progress closely and I wish I could play a bigger part in it, but I just don't have the knowledge. I wish you all the luck and you'll probably hear from me again soon. ;)
Title: Re: Convert folder.jpg to cover.bmp
Post by: Llorean on October 14, 2008, 06:21:18 PM
He didn't say he was working on it, and you aren't the first person to ask for jpeg album art. If you want to "do your part", start working on an efficient way to incorporate it rather than saying "someone else should do this."

Most ideas never happen just because nobody works on them. This one has people for and against it, but it's really impossible to decide until someone actually comes up with an implementation and shows how much, or how little, impact it would have.
Title: Re: Convert folder.jpg to cover.bmp
Post by: RubenK on October 14, 2008, 06:31:07 PM
I'm sorry if I sounded like I was implying that someone should be working on this, that's totally your call. Really, I wish I had the knowledge to start something up, but I can't even begin thinking about something in theory let alone actually doing some programming. I understand a lot of ideas never happen due to lack of men power (and the will for doing something), but I'm just not able to anything more than complain about stuff, I'm sorry! :P
I just hope that by bringing this issue up, people who do have the knowledge (and time!) see a use in solving this. It's up to you if do something with it or not. All I can do is say that, in my opinion, there is a need for jpg support.
Title: Re: Convert folder.jpg to cover.bmp
Post by: Llorean on October 14, 2008, 06:37:17 PM
And I'm saying "everyone who works on Rockbox was, at one point, someone who knew nothing about programming."

Just spend a little of your spare time each week reading a book on C, or looking and playing with the Rockbox source, and you'll find it coming to you.
Title: Re: Convert folder.jpg to cover.bmp
Post by: RubenK on October 14, 2008, 06:40:37 PM
That's something that's very, very true. I will see what I can do. Momentarily I have little spare time left, due to exams. But I'm able to understand Linux, so Rockbox will be just 'the next challenge'. You'll hear from me. ;D