[ID3 Dev] Why is footer not included in total size?

Jim jmartin92 at comcast.net
Wed Nov 15 10:22:41 PST 2006

----- Original Message ----- 
From: "Ray Manning" <ray at homeautomationdev.com>
To: <id3v2 at id3.org>
Sent: Wednesday, November 15, 2006 8:46 AM
Subject: RE: [ID3 Dev] Why is footer not included in total size?

> >
> > And I still think that the footer flag is useful.  Sure you can check
> > last 10 bytes of the tag data to see if it is a footer, but isn't
> > it easier
> > to check one flag bit instead of comparing 10 bytes for the
> > format?  (This method may not confirm that the footer is valid as
> > but it does tell you to expect it to be there.)  If I'm parsing a tag
> > contains a footer, I can just subtract 10 bytes from the expected size
> > the tag data/padding and deal with the footer later, if I need to.  (If
> > is a prepended tag and I do not change the overall size of the tag or
> > flag byte, I can skip over dealing with the footer entirely.)
> >
> I agree the flag is useful as the spec is written today, but it is not
> necessary
> if the spec had made the tag size include the footer size.
> If you're parsing a prepended tag that contains a footer, you can ignore
> the footer all together unless you are going to resize the tag or modifiy
> the header flags. I'm assuming here that the tag size would include the
> footer
> size. Since the tag size doesn't include the footer size, then the bit is
> needed in order to determine where the end of the tag is.
> If you were parsing an appended tag, then you already know about the
> so the flag won't be used.
> I think we are in agreement, just confusing reality and the topic.

I'm not sure we are in agreement.  Even if the tag size includes the footer
size, I think the footer flag is useful.  If you have a prepended header
with a given size (including the footer if it is present), there are two
ways you can know that it contains a footer at the end.  One is to have a
flag that tells you it does.  The other way would be to compare the last 10
bytes of what should be the tag data and compare it against the format of
the footer.  Personally, I think checking a flag bit is much easier to do.
It's like you said - if you aren't changing the size or other flags, you can
skip processing the footer entirely.  But you can't do that if you don't
have a flag that tells you those last 10 bytes are footer data and not tag
data.  (You have to at least do the comparison of those byte against the
footer format to see if it is a footer or not.)

PS--I've done a little work with reading/writing other types of tags (APEv2,
ID3v1, Lyrics3 v2) so if you are looking for any help with your tool
development feel free to email me directly.

To unsubscribe, e-mail: id3v2-unsubscribe at id3.org
For additional commands, e-mail: id3v2-help at id3.org

More information about the ID3v2 mailing list