Detect whether or not an id3v1 tag exists

Jim jmartin92 at
Fri Dec 10 18:32:52 CET 2010

Joel Verhagen wrote:
> I have looked more on this topic and even raised the question on
> StackOverflow, so my C++ superiors could take a look:
> .
> Hexagon points out that at the end of the MPEG::File::read function is
> a call to ID3v2Tag(true); and ID3v1Tag(true);
> Does anyone know why this is here? In the meantime, I created three
> replacement functions bool hasID3v2(), bool hasID3v1(), bool hasAPE()
> that pass through the internal boolean used to say whether or not the
> MPEG file has ID3v1/ID3v2/APE tags.
> Joel Verhagen

Hi Joel.

I have also wondered about the tag creation that takes place in 
MPEG::File::read.  I can't figure out the reason for that being there and it 
does break the report return of a null for both ID3v2Tag() and ID3v1Tag(). 
Maybe someone can dig through the SVN repo and figure out when it was added and 
why.  But I have commented out those two lines of code and it doesn't seem to 
break anything that I've noticed so you could use that as a temporary fix.

(I did see on your stackoverflow question that you were worried about possible 
errors but if you comment out the code and test your app you might find errors 
that didn't come up for me and that could give us a clue as to why the code is 
there in the first place.)


More information about the taglib-devel mailing list