Determine size of tag

Aneurin Price aneurin.price at gmail.com
Fri Sep 26 19:23:58 CEST 2008


Hello,

I'm trying to write some heuristics to tell if two audio files are
likely to be the same, and one of the things I'd like to use is the
file size (since that's a cheap metric - if they're completely
different then there's no point doing anything more involved), but
different tags can change the size of the file even though the content
is the same. As an example, say you have a file on a shared drive and
one user retags it to fix a typo, renaming it in the process; I'd like
to be able to make an educated guess that it's the same file.

So, is it possible to use taglib to determine how much space is used
by the tag, short of stripping it and then writing the file back out
again to compare the sizes?

It looks like TagLib::ID3v2::Header::completeTagSize() should do what
I want for MP3s (if I've understood the docs correctly), but I can't
see a more general way to get that information. Does anybody have any
suggestions?

Thanks,

-Aneurin Price


More information about the taglib-devel mailing list