Hi,<br><br>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.<br>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.<br><br><br>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 documentation<br>
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.<br><br>Belwo is the code snippet for api:-<br>===============================================================<br>
<div id=":162">char *taglib_tag_id3v2_albumart(char *pFile,int *size)<br>{<br> TagLib::ID3v2::FrameList listOfMp3Frames;<br> ID3v2::AttachedPictureFrame * pictureFrame;<br>
TagLib::ID3v2::Tag *mp3tag;<br> char *pImgBuffer = NULL;<br><br> if(pFile != NULL)<br> {<br> TagLib::MPEG::File mp3File(pFile);<br> mp3tag = mp3File.ID3v2Tag();<br>
<br> if(mp3tag)<br> {<br> listOfMp3Frames = mp3tag->frameListMap()["APIC"];//look for picture frames only<br><br> if(!listOfMp3Frames.isEmpty())<br>
{<br> TagLib::ID3v2::FrameList::ConstIterator it= listOfMp3Frames.begin();<br> pictureFrame = static_cast<ID3v2::AttachedPictureFrame *> (*it);//cast Frame * to AttachedPictureFrame*<br>
*size = pictureFrame->picture().size();<br> pImgBuffer = (char *)calloc(pictureFrame->picture().size(),sizeof(char));<br> memcpy(pImgBuffer,pictureFrame->picture().data(),pictureFrame->picture().size());<br>
return pImgBuffer;<br> }<br> }<br> }<br> return NULL;<br>}<br>========================================================================================================</div>
<br>Is this is the correct way to do ? Or Need to write generic implementation for picture-frame feature ?<br><br>Note: My application is in C and I could not extend Tag-lib to support this feature in my app.<br><br>Please help me to solved this issue.<br>
<br>Thanks,<br>Mahendra<br><br><br><br><br><br><br><br><br><br><br><br><br>