(1.9.3) Txxx multiple values

Locked
snx
User
Posts:3
Joined:Mon Nov 26, 2012 2:28 pm
Are you a spambot?:no
(1.9.3) Txxx multiple values

Post by snx » Mon Nov 26, 2012 3:24 pm

There might be a problem reading tags with multiple values (null-characted-separated).
I attached an id3v2 tagged file with two artists, Adam & Eva.
=> TPE1 = "Adam<NULL>Eva"
Besides the tag was created with Mp3tag v2.52.


Regarding your array structure i expected to get:

Code: Select all

$id3[comments][artist][0] = "Adam"
$id3[comments][artist][1] = "Eva"
But i got:

Code: Select all

$id3[comments][artist][0] = "AdamEva"
Comparing the the length of the artist field in comments and comments_html i found the null-character

Code: Select all

strlen($id3[comments][artist][0]) = 8
strlen($id3[comments_html][artist][0]) = 7
By splitting the value i got what i needed, but i thought this should be done by the id3 engine:

Code: Select all

$id3[comments][artist] = split("\0", $id3[comments][artist][0]);
Attachments
test.mp3
(31.9KiB)Downloaded 876 times

snx
User
Posts:3
Joined:Mon Nov 26, 2012 2:28 pm
Are you a spambot?:no

Re: (1.9.3) Txxx multiple values

Post by snx » Mon Nov 26, 2012 3:34 pm

i used "explode" instead of "split"... sorry

James Heinrich
getID3() v1 developer
Posts:1477
Joined:Fri May 04, 2001 4:00 pm
Are you a spambot?:no
Location:Northern Ontario, Canada
Contact:

Re: (1.9.3) Txxx multiple values

Post by James Heinrich » Mon Nov 26, 2012 4:16 pm

The official definition of the artist field says:
http://id3.org/id3v2.3.0 wrote:TPE1
The 'Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group' is used for the main artist(s). They are seperated with the "/" character.
From that perspective the tag as created by MP3tag is technically incorrect. But MP3tag's implementation actually makes more sense (you probably wouldn't want to render "AC/DC" as two separate artists, for example). See attached patched module to handle null-splitting (keeping in mind the variable text encodings available in ID3v2). I think I'll leave the /-split issue to the user due to the problem of differentiating actual multiple values vs desired legitimate / characters.

Change will be included in v1.9.5

BTW: if you are willing and able to produce a worse-case test file, with more than 2 artists (and ideally multiple values for original artist, etc -- any field that supports multiple values in MP3tag) I'd be interested in it.
Attachments
module.tag.id3v2.php
(131.01KiB)Downloaded 845 times

snx
User
Posts:3
Joined:Mon Nov 26, 2012 2:28 pm
Are you a spambot?:no

Re: (1.9.3) Txxx multiple values

Post by snx » Mon Nov 26, 2012 10:55 pm

Thank you very much for your immediate reply and the given file.

You're right quoting id3v2.3.0, but within id3v2.4.0 it says:
http://id3.org/id3v2.4.0-frames wrote: 4.2. Text information frames
...
All text information frames supports multiple strings, stored as a null separated list, where null is reperesented by the termination code for the charater encoding.
...
4.2.2. Involved persons frames
...
TPE1
The 'Lead artist/Lead performer/Soloist/Performing group' is used for the main artist.
...
Regarding the test file, i'll try to create one...

James Heinrich
getID3() v1 developer
Posts:1477
Joined:Fri May 04, 2001 4:00 pm
Are you a spambot?:no
Location:Northern Ontario, Canada
Contact:

Re: (1.9.3) Txxx multiple values

Post by James Heinrich » Mon Nov 26, 2012 11:12 pm

snx wrote:You're right quoting id3v2.3.0, but within id3v2.4.0 it says
Fair enough, but the sample file you provided was v2.3 :)

Locked