Removing pictures from ID3v2 tag

Stefan Vunckx stefan.vunckx at
Mon Apr 2 23:01:50 CEST 2007


I seem to have some trouble removing pictures from an mp3's ID3v2 tag using 

This is my code:

TagLib::MPEG::File file( ... );
if ( file.ID3v2Tag() ) {
TagLib::ID3v2::FrameList l= file.ID3v2Tag()->frameListMap()["APIC"];
for( std::list<TagLib::ID3v2::Frame*>::iterator iter = l.begin(); iter != 
l.end(); iter++ ) {
  TagLib::ID3v2::AttachedPictureFrame *frame = 
static_cast<TagLib::ID3v2::AttachedPictureFrame *>( *iter );
  file.ID3v2Tag()->removeFrame( frame, TRUE );

Is what I'm doing so wrong ? Ive tested this in my Qt application, using mp3s 
who have 1 or more pictures attached, and although there are no error 
messages, the images do not get removed either. If I reload the tags, the 
images re-appear.

If someone can point me to what it is I am missing, I would be grateful ! ;-)
Please CC me as I am not on the taglib-devel list.

Stefan Vunckx

More information about the taglib-devel mailing list