Removing pictures from ID3v2 tag

Stefan Vunckx stefan.vunckx at skynet.be
Sat Apr 7 12:11:05 CEST 2007


No, it return TRUE but - and this is embarrassing now - as it turns out I was 
saving to a file which was to be overwritten by a copy of the original file 
in the code shortly after, so no wonder the images were not removed.

Thus I apologise for the stupid mail, I think I had too much coffee that 
night, or too little. One can never be sure when it comes to coffee!

Regards,
Stefan Vunckx

On Thursday 05 April 2007 07:01:44 Vitali Lovich wrote:
> Are you sure that save is returning true?  It could be that if you still
> have a file handle open to the file in another application, then the
> code may fail to save the file depending on what kind of lock TagLib and
> the other app request.
>
> Stefan Vunckx wrote:
> > Hello,
> >
> > I seem to have some trouble removing pictures from an mp3's ID3v2 tag
> > using TagLib.
> >
> > 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 );
> > }
> > file.save();
> > }
> >
> > 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.
> >
> > Regards,
> > Stefan Vunckx
> > _______________________________________________
> > taglib-devel mailing list
> > taglib-devel at kde.org
> > https://mail.kde.org/mailman/listinfo/taglib-devel




More information about the taglib-devel mailing list