FS#12795 - Album art for FLAC and Ogg

Attached to Project: Rockbox
Opened by Evan Ramos (Hendricks266) - Monday, 31 December 2012, 20:02 GMT
Task Type Patches
Category ID3 / meta data
Status Unconfirmed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Release 3.12
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


I am working on adding album art support for FLAC and Ogg files. FLAC looks straightfoward, but there is a design problem with Ogg.

The struct containing the image and associated data is base64 encoded. I can't just set id3->albumart.pos to a location in the file like all other supported album art formats (and FLAC). Obivously I could allocate memory for the decoded base64 data, but it would have to be deallocated later to prevent a leak.

On IRC, nick_p suggested: "how about adding a new id3 struct element id3->albumart.base64_encoded=true and decoding it when needed on the fly?" This sounds like a good idea, with one issue: it's not the album art alone that is base64 encoded, but the data struct described here:

I can test to see if I can parse the beginning of the base64 block, then set the pos pointer to the middle of of the block (with the id3 struct addition) and see if it will still decode.
This task depends upon

Comment by MichaelGiacomelli (saratoga) - Tuesday, 01 January 2013, 03:19 GMT
I believe unhelpful suggested years ago when he implemented our jpeg decoder that ogg art could be implemented by adding another jpeg parser, this one for a base64 coded jpeg stream.
Comment by Nils Wallménius (nls) - Sunday, 09 June 2013, 21:04 GMT
Shouldn't it be possible to decode the base64 data in place and then pass it to the regular jpeg decoder?
Comment by Dominik Riebeling (bluebrother) - Thursday, 13 June 2013, 19:58 GMT
We have a rather similar situation for mp3 album art if the id3v2 tag has the "unsynchronized" bit set. Currently we ignore such album art.