How to Implement Picture frame feature of Id3v2 in TagLIb ?

mahendra Deore mahendradeore at
Tue Sep 27 13:49:21 UTC 2011


As I gone through the taglib's folder "bindings/c/". In which tag_c.cpp and
tag_c.h having complete implementation to get generic features of all
supported formats.
As Taglib does not implement every feature of ID3v2. But if I want picture
frame feature should be the part of taglib ,instead of extend Taglib to
support this feature in application.

To support  this I have written api inside "bindings/c/tag_c.cpp" file which
gives me picture frame buffer and buffersize. To implement this using ref of
at Taglib site. But this api is not generic only specific to id3v2 . This
api is independent of other API and works fine for me.

Belwo is the code snippet for api:-
char *taglib_tag_id3v2_albumart(char  *pFile,int *size)
        TagLib::ID3v2::FrameList listOfMp3Frames;
        ID3v2::AttachedPictureFrame * pictureFrame;
        TagLib::ID3v2::Tag *mp3tag;
        char *pImgBuffer = NULL;

        if(pFile != NULL)
                TagLib::MPEG::File mp3File(pFile);
                mp3tag = mp3File.ID3v2Tag();

                        listOfMp3Frames =
mp3tag->frameListMap()["APIC"];//look for picture frames only

                                TagLib::ID3v2::FrameList::ConstIterator it=
                                pictureFrame =
static_cast<ID3v2::AttachedPictureFrame *> (*it);//cast Frame * to
                                *size = pictureFrame->picture().size();
                                pImgBuffer = (char

                                return pImgBuffer;
        return NULL;

Is this is the correct way to do ? Or Need to write generic implementation
for picture-frame feature ?

Note: My application is in C and I could not extend Tag-lib to support this
feature in my app.

Please help me to solved this issue.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the taglib-devel mailing list