Incorrect track number readings

The place for "I can't figure out how to..." questions.
Post Reply
andrewjs
User
Posts: 3
Joined: Sun Feb 03, 2008 5:26 am

Incorrect track number readings

Post by andrewjs » Sun Feb 03, 2008 5:31 am

I am using getID3 on PHP 5.2.1. Everything works like a charm except for track numbers of 3 digits in length. I have several mp3's with track numbers between 900 and 950, but they are all getting translated as tracks in the 120-170 region, approx. This is throwing off playlists based on track numbers in the music streaming application I am using. Any idea why this bug is occurring and maybe what I can do to stop it?

I am new to getID3, and I cannot find in the files what version I am using.

Thanks,
Andrew

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:

Post by James Heinrich » Sun Feb 03, 2008 3:27 pm

ID3v1 is incapable of storing track numbers larger than 255 (it uses a single unsigned byte, range 0-255). ID3v2 (and other tagging systems) should have no problem with track numbers in that range (900-950).

andrewjs
User
Posts: 3
Joined: Sun Feb 03, 2008 5:26 am

Post by andrewjs » Sun Feb 03, 2008 5:06 pm

James Heinrich wrote:ID3v1 is incapable of storing track numbers larger than 255 (it uses a single unsigned byte, range 0-255). ID3v2 (and other tagging systems) should have no problem with track numbers in that range (900-950).
Using Ultra Tag Editor, I was able to verify that all my tracks are ID3v2.3, so apparently this isn't the reason why getid3() isn't translating track numbers correctly. It's a real bummer, any other guesses?

Thanks for the help,

Andrew

andrewjs
User
Posts: 3
Joined: Sun Feb 03, 2008 5:26 am

Post by andrewjs » Sun Feb 03, 2008 5:14 pm

OK, now I know what is happening. getid3() is for some reason converting my ID3v2 tags into ID3v1 on the PHP end. Using Ultra Tag Editor, I copied an v2 tag into v1, and sure enough, the track number changed to same as what happens when getid3() reads the v2 tags.. Even though the mp3's I uploaded to my php server do not have v1 tags, getid3() translates them into one. strange, any ideas on this? Anyway to get getid3() to just read the v2 tags as they are?
andrewjs wrote:
James Heinrich wrote:ID3v1 is incapable of storing track numbers larger than 255 (it uses a single unsigned byte, range 0-255). ID3v2 (and other tagging systems) should have no problem with track numbers in that range (900-950).
Using Ultra Tag Editor, I was able to verify that all my tracks are ID3v2.3, so apparently this isn't the reason why getid3() isn't translating track numbers correctly. It's a real bummer, any other guesses?

Thanks for the help,

Andrew

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:

Post by James Heinrich » Sun Feb 03, 2008 5:49 pm

I am unable to replicate your problem. Using a couple test files with large ID3v2 track numbers (950 and 951 in my test files), getID3 returns the right track number in all the right places:

$data['tags']['id3v2']['track_number']
$data['id3v2']['comments']['track_number'][0]
$data['comments']['track_number'][0]

If I put a value into an ID3v1 tracknumber, it also shows up in the appropriate places (and doesn't clobber the ID3v2 values):

$data['tags']['id3v1']['track']
$data['id3v1']['track']
$data['comments']['track'][0]

Post Reply