File/libmagic: What is the “ID3 length”

file-command

The man pages of the file command/libmagic are talking about a datatype called "ID3 length".
The only explanation i found was:
A 32-bit ID3 length

So what is this for a type ? Is it related to the ID3-Tag in mp3s ?

Best Answer

The magic(5) manual page says only (referring to this as a datatype):

  beid3   A 32-bit ID3 length in big-endian byte order.

  leid3   A 32-bit ID3 length in little-endian byte order.

and libmagic's associating the ID3 tags with mp3 has been noticed, e.g., Discussion: libmagic for MP3 can go horribly wrong, since the feature was added in 2008:

2008-11-06 18:18  Christos Zoulas <christos@zoulas.com>

    * Handle ID3 format files.

The ID3 format stores the tag length as a special 32-bit integer (which is the length you are asking about):

The ID3v2 tag size is stored as a 32 bit synchsafe integer (section 6.2), making a total of 28 effective bits (representing up to 256MB).

Further reading:

Related Question