Disagreement between MPEG::File::ID3v1Tag docs and behavior

Ιντζόγλου Θεόφιλος int.teo at gmail.com
Thu Aug 7 02:43:34 CEST 2008


Hello,

I also have noticed this problem. I am the developer of a tagging program 
(mediatagtools) and I want my mp3 files to have only id3v2 tags. However when 
an mp3 is opened now a id3v1 tag is created (even though it's empty) and is 
then saved in the file. This didn't happen with taglib 1.4. Is there a 
specific reason for the two added lines  in mpegfile.cpp ? Removing those 
taglib seem to work again as it should be.

Theofilos

Στις Thursday 03 July 2008 14:15:11 ο/η Jim έγραψε:
> Hi Tom.
>
> I'm not sure of the reason for the tag creation when reading an MPEG file. 
> I've noticed a couple other places where I think it might cause problems. 
> However, a better way to check if a tag exists might be to check if you get
> a valid pointer and if you do, check to make sure the tag returned isn't
> empty.  Something like:
>
> if ( ID3v1Tag() && !ID3v1Tag()->isEmpty() )
>
> should tell you if a valid tag exists.
>
> Hope this helps.
>
> Jim
>
> Tom Kleinpeter wrote:
> > Hello,
> >
> > The ID3v1Tag and ID3v2Tag functions have notes like these in the docs:
> >
> > "If create is false (the default) this will return a null pointer if
> > there is no valid ID3v1 tag. If create is true it will create an ID3v1
> > tag if one does not exist."
> >
> > But, I'm not seeing that behavior in practice -- I'm always getting a
> > valid pointer even if there isn't a tag on the file.  Looking at the
> > read() function in mpegfile.cpp in the current release, I see these
> > lines which seem to contradict what the docs say:
> >
> > // Make sure that we have our default tag types available.
> >   ID3v2Tag(true);
> >   ID3v1Tag(true);
> >
> > Going through the logs, those were added at revision 768978 along with
> > a bunch of other changes.
> >
> > Is this a bug?  If this is the correct behavior and the docs are just
> > out of date, what is the correct way to check if a file has tags?
> >
> > Thanks,
> > Tom
> > _______________________________________________
> > taglib-devel mailing list
> > taglib-devel at kde.org
> > https://mail.kde.org/mailman/listinfo/taglib-devel
>
> _______________________________________________
> 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