Fail to extract cover art from mp3

Ken Choy Ken.Choy at wdc.com
Tue Dec 11 20:44:21 UTC 2012


I am using TagLib-1.8 to try to extract cover art from an ID3v2.3.0 mp3 file which contains the following at the beginning (displayed in hex dump output):
00000000  49 44 33 03 00 00 00 04  4c 39 54 50 45 31 00 00  |ID3.....L9TPE1..|
00000010  00 0a 00 00 00 42 6f 62  20 44 79 6c 61 6e 54 59  |.....Bob DylanTY|
00000020  45 52 00 00 00 05 00 00  00 31 39 36 35 54 43 4f  |ER.......1965TCO|
00000030  4d 00 00 00 01 00 00 00  54 4f 50 45 00 00 00 01  |M.......TOPE....|
00000040  00 00 00 54 43 4f 50 00  00 00 01 00 00 00 57 4f  |...TCOP.......WO|
00000050  41 52 00 00 00 00 00 00  54 45 4e 43 00 00 00 01  |AR......TENC....|
00000060  40 00 00 41 50 49 43 00  01 25 4e 00 00 00 69 6d  |@..APIC..%N...im|
00000070  61 67 65 2f 6a 70 65 67  00 00 00 ff d8 ff e0 00  |age/jpeg........|
00000080  10 4a 46 49 46 00 01 01  01 00 7e 00 7e 00 00 ff  |.JFIF.....~.~...|
00000090  e1 0c 3a 45 78 69 66 00  00 49 49 2a 00 08 00 00  |..:Exif..II*....|
000000a0  00 02 00 46 47 03 00 01  00 00 00 00 00 00 00 12  |...FG...........|
000000b0  50 04 00 01 00 00 00 01  00 00 00 26 00 00 00 03  |P..........&....|
000000c0  00 28 01 03 00 01 00 00  00 02 00 00 00 01 02 04  |.(..............|
000000d0  00 01 00 00 00 50 00 00  00 02 02 04 00 01 00 00  |.....P..........|
000000e0  00 e2 0b 00 00 00 00 00  00 ff d8 ff e0 00 10 4a  |...............J|
000000f0  46 49 46 00 01 01 01 00  0f 00 0f 00 00 ff db 00  |FIF.............|
00000100  43 00 08 06 06 07 06 05  08 07 07 07 09 09 08 0a  |C...............|
00000110  0c 14 0d 0c 0b 0b 0c 19  12 13 0f 14 1d 1a 1f 1e  |................|
00000120  1d 1a 1c 1c 20 24 2e 27  20 22 2c 23 1c 1c 28 37  |.... $.' ",#..(7|
00000130  29 2c 30 31 34 34 34 1f  27 39 3d 38 32 3c 2e 33  |),01444.'9=82<.3|
00000140  34 32 ff db 00 43 01 09  09 09 0c 0b 0c 18 0d 0d  |42...C..........|
00000150  18 32 21 1c 21 32 32 32  32 32 32 32 32 32 32 32  |.2!.!22222222222|
00000160  32 32 32 32 32 32 32 32  32 32 32 32 32 32 32 32  |2222222222222222|
...

Used the following TagLib framelist.cpp module (framelist program in examples sub-directory) to dump frames but the APIC frame is not picked up i.e. not displayed:

int main(int argc, char *argv[])
{
  // process the command line args


  for(int i = 1; i < argc; i++) {

    cout << "******************** \"" << argv[i] << "\"********************" << endl;

    MPEG::File f(argv[i]);

    ID3v2::Tag *id3v2tag = f.ID3v2Tag();

    if(id3v2tag) {

      cout << "ID3v2."
           << id3v2tag->header()->majorVersion()
           << "."
           << id3v2tag->header()->revisionNumber()
           << ", "
           << id3v2tag->header()->tagSize()
           << " bytes in tag"
           << endl;

      ID3v2::FrameList::ConstIterator it = id3v2tag->frameList().begin();
      for(; it != id3v2tag->frameList().end(); it++)
        cout << (*it)->frameID() << " - \"" << (*it)->toString() << "\"" << endl;
    }
    else
      cout << "file does not have a valid id3v2 tag" << endl;
...


If I change APIC's picture type from 00 (Other) to 03 (front Cover), TagLib-1.8 still fails to extract the APIC frame information via the framelist program.  However,  I am able to see the cover art using MediaMonkey and Mp3tag.

Any suggestions?

Thanks.

Ken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20121211/dd8f9eb6/attachment.html>


More information about the taglib-devel mailing list