Discussion:
Can text frames be empty
Dale Preston
2007-02-11 19:28:45 UTC
Permalink
The description for ID3V2.3 frames says that frames must include at least
one byte of data. How does this rule applied to text frames? For instance,
if track number is not set, is a TRCK frame with the frame data as { 0, 0 },
representing an encoding byte, no string data, and then a null termination
byte, considered a valid frame?



If it is valid, is it still better to remove the empty frame? For instance,
if track number is not set, is it better to leave an existing TRCK frame
with 0,0 for the data or is it better to remove the TRCK frame altogether?



Thanks,





Dale
Dale Preston
2007-02-13 03:12:00 UTC
Permalink
I thought that the null termination was explicitly excluded except in list
items such as in V2.4 or where specifically identified such as in frames
like APIC and COMM.

I was surprised to find out from Jud last week that the null termination
could optionally be used.

Dale


-----Original Message-----
From: Scott Wheeler [mailto:***@kde.org]
Sent: Sunday, February 11, 2007 9:39 PM
To: ***@id3.org
Subject: Re: [ID3 Dev] Can text frames be empty
Post by Dale Preston
The description for ID3V2.3 frames says that frames must include at least
one byte of data. How does this rule applied to text frames? For instance,
if track number is not set, is a TRCK frame with the frame data as { 0, 0 },
representing an encoding byte, no string data, and then a null termination
byte, considered a valid frame?
It's valid from the perspective of the general frame definition --
specifically, for its purposes, everything after the frame header is
"data" including the encoding byte.

Also note (as this seems to be something that most people haven't
caught) that null termination of strings is neither required nor
recommended in the ID3v2 standards. In ID3v2.3 it simply implies that
everything following that should be ignored; in 2.4 it is used as the
separator for a list of values. Thus a null terminated string in 2.4
with a strict parser would imply a list of ( "value", "" ).
Post by Dale Preston
If it is valid, is it still better to remove the empty frame? For instance,
if track number is not set, is it better to leave an existing TRCK frame
with 0,0 for the data or is it better to remove the TRCK frame altogether?
I think that's up to you. I'd tend to say culling them while parsing
the tag is the way to go.

Cheers,

-Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: id3v2-***@id3.org
For additional commands, e-mail: id3v2-***@id3.org

Loading...