Range of PHP errors and warnings

Think you found a bug in getID3()? Post here with details.
Post Reply
hisorhers
User
Posts: 10
Joined: Mon Sep 08, 2014 12:18 am
Are you a spambot?: no

Range of PHP errors and warnings

Post by hisorhers » Mon Sep 08, 2014 12:24 am

Hello there!

Here are warnings & errors I have recieved from GetID3:

PHP Warning: strpos(): Empty delimiter in getid3/module.tag.id3v2.php on lines 976|690|701|931|1273|872|1376|1386
PHP Warning: explode() expects parameter 2 to be string, array given in getid3/module.tag.apetag.php on line 224
PHP Notice: Undefined offset: 1 in getid3/module.tag.apetag.php on line 183
PHP Notice: Undefined offset: 2 in getid3/module.tag.apetag.php on line 176
PHP Notice: Undefined index: lyrics3 in getid3/module.tag.lyrics3.php on line 108

Here are errors which I'm not sure if they were from getID3 or my own script (they are related to using createimagefromstring function, but I suppress errors with an @ symbol for that function so maybe getID3 works with GD too?):

libpng warning: Ignoring bad adaptive filter type
Bogus Huffman table definition
Unsupported marker type 0x38
Unsupported JPEG process: SOF type 0xc8
Invalid JPEG file structure: two SOF markers
libpng warning: Ignoring attempt to set cHRM RGB triangle with zero area

Also, I've noticed 'comments' array key doesn't always provide the right output, so now I re-do it with the following and it works just fine:

$id3v1 = isset($getid3['tags']['id3v1']) && is_array($getid3['tags']['id3v1']) ? $fileInfo['tags']['id3v1'] : array();
$id3v2 = isset($getid3['tags']['id3v2']) && is_array($getid3['tags']['id3v2']) ? $fileInfo['tags']['id3v2'] : array();
$comments = array_merge($id3v1, $id3v2);

Thanks for creating GetID3, it's very useful! ;)

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

Re: Range of PHP errors and warnings

Post by James Heinrich » Mon Sep 08, 2014 12:49 am

Can you please confirm which version of getID3 those error-on-line-number are based on?

Can you provide a sample file that spawns any/all of the reported errors?

When you say that the 'comments' array doesn't provide the "right" output, please give a more specific example of what your various tags contain and what getID3 returns, and what you think it should return. A sample file could also be useful to illustrate.

hisorhers
User
Posts: 10
Joined: Mon Sep 08, 2014 12:18 am
Are you a spambot?: no

Re: Range of PHP errors and warnings

Post by hisorhers » Mon Sep 08, 2014 9:31 am

> Can you please confirm which version of getID3 those error-on-line-number are based on?
1.9.3

> Can you provide a sample file that spawns any/all of the reported errors?
I mass-inserted many files with getID3, as a result a small % of them caused this problem (all of which worked with ffmpeg). I didn't log which files caused this problem :(

> When you say that the 'comments' array doesn't provide the "right" output, please give a more specific example of what your various tags contain and what getID3 returns, and what you think it should return. A sample file could also be useful to illustrate.
In some cases, the $getID3['comments']/$getID3['comments_html'] returned IDv2 when the mp3 file had both IDv1 and IDv2. Using that array_merge fixed this problem. I will try to hunt down the files which caused this problem and post them to you.

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

Re: Range of PHP errors and warnings

Post by James Heinrich » Mon Sep 08, 2014 7:44 pm

The current version is 1.9.8, your version is nearly 3 years old. Please try again with the [ur=https://github.com/JamesHeinrich/getID3 ... master.zip]current version[/url] and report any issues you may find with that version.

[comments] is a merge of the contents of [tags], which may include ID3v2, ID3v1, APE, Lyrics3, Ogg, QuickTime, RIFF, etc tag formats depending on the source file format. There shouldn't be anything present in [tags][id3v2] that's not present in [comments]. If the same tag value is present in multiple sources (e.g. same Year in both ID3v1 and ID3v2) it will only appear once in [comments].
If you find a file that is not behaving as described above with the current version of getID3, please submit it for analysis.

hersorhis
User
Posts: 1
Joined: Tue Oct 07, 2014 5:06 pm
Are you a spambot?: no

Re: Range of PHP errors and warnings

Post by hersorhis » Tue Oct 07, 2014 5:15 pm

Hi James,

The newest version still has the same problem regarding the undefined offsets in module.tag.apetag.php, maybe isset() or count() before running the list(). strpos() errors still occur and so does lyrics3.

Also, a better explaination for the reasoning behind "array_merge($id3v1, $id3v2);" is that the current system overlaps ID3v1 tags over ID3v2 tags sometimes, ID3v1 sometimes has corrupt ID3 information if it's Japanese or Russian (even when I change the encodings for ID3v1 to UTF-8), the fix was to priorties v2 over v1 tags.

Finally, in the configuration, you should recommend people to use "$getID3->encoding_id3v1 = 'Windows-1251';" since from my experiments this has by far the largest amount of supported mp3s in comparison to the currently suggested CP1252 (tested with over 10 million files).

Thank you.

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

Re: Range of PHP errors and warnings

Post by James Heinrich » Fri Oct 17, 2014 3:23 pm

If you have a sample file that produces undefined offsets and so forth, please send me a link to it (or just email me the file) and I'll take a look.
Same thing for a sample file where the output of [comments] is not a sensible merge of ID3v1 and ID3v2.

hisorhers
User
Posts: 10
Joined: Mon Sep 08, 2014 12:18 am
Are you a spambot?: no

Re: Range of PHP errors and warnings

Post by hisorhers » Mon Oct 20, 2014 4:07 pm

I've sent you an email via the address on your GitHub profile.

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

Re: Range of PHP errors and warnings

Post by James Heinrich » Mon Oct 20, 2014 4:42 pm

For getID3 related issues please email info@getid3.org

hisorhers
User
Posts: 10
Joined: Mon Sep 08, 2014 12:18 am
Are you a spambot?: no

Re: Range of PHP errors and warnings

Post by hisorhers » Thu Oct 23, 2014 7:05 pm

Sent. I didn't scroll down to the bottom of getid3.org's homepage so I couldn't find that email address :)

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

Re: Range of PHP errors and warnings

Post by James Heinrich » Fri Oct 24, 2014 12:40 pm

I don't appear to have received (either of) your emails. Please try sending again. Alternately, PM me a link to your sample file here on the forum.

info@getid3.org is listed at the top of all getId3 source files, as well as on my forum profile here.

hisorhers
User
Posts: 10
Joined: Mon Sep 08, 2014 12:18 am
Are you a spambot?: no

Re: Range of PHP errors and warnings

Post by hisorhers » Sat Oct 25, 2014 6:51 pm

PM sent.

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

Re: Range of PHP errors and warnings

Post by James Heinrich » Sun Oct 26, 2014 3:23 am

James Heinrich wrote:I don't appear to have received (either of) your emails.
Actually I did receive your emails. Naturally they ended up in the spam folder, but I had trouble finding them in the maze of spam (averages around 100 new spam per day) because the subject didn't reference "getID3" and it wasn't (initially) sent to info@getid3.org But I found the email(s) now.
hisorhers wrote:PHP Warning: strpos(): Empty delimiter in getid3/module.tag.id3v2.php
The sample file I looked at (0bb25b9b013ba7946737d25c7df9a9620a508ee8) had an improperly-constructed WXXX frame in the ID3v2 tag, which meant that the first byte of data which should contain an index for the text encoding used for the data returned an invalid value, and this wasn't properly handled (a getID3 warning was correctly generated saying that ISO-8859-1 encoding was being assumed, but the code didn't actually do that correctly).
Fixed in c381cedb2e06c02316d7be5d1be6c11b3e930604
hisorhers wrote:PHP Notice: Undefined offset: [1|2] in getid3/module.tag.apetag.php
The sample file I looked at (d9bc834560d8fc6b21cb3d59eed1ad2b2c7e66a5) had spam data advertising (apparently) a Chinese music-sharing site, with the same URL + ad text spammed into not only the usual text fields such as artist, title, album, etc, but also specialized fields such as replaygain_track_gain, mp3gain_minmax, etc. Where these values were parsed by getID3 they did not contain the expected data format and therefore generated PHP warnings.
Fixed in d9c99e32afadf025f8e4cd0d6d2c7c206fa9e499
hisorhers wrote:PHP Warning: explode() expects parameter 2 to be string, array given in getid3/module.tag.apetag.php
The sample file I looked at (cc44c9506b3517b3678a74c97b8d663e6955f0cc) had an (purportedly identical) embedded cover art image in both ID3v2 and APE. The data element in the APE tag should have been flagged as Binary data, but it was flagged as UTF-8 text, which generated a PHP warning when parsing the cover art entry. Incidentally I say "purportedly identical" because the APE version is truncated at 10377 (of 59529) bytes.
Fixed in 0978dfc20bdb732877aa3b2f846aba610cbb8c2b
hisorhers wrote:PHP Notice: Undefined index: lyrics3 in getid3/module.tag.lyrics3.php
The sample file I looked at (72142a3038f4e82d508ac001f81f97ae5930b82f) had a mishmash of Lyrics3 and APEtag data at the end of the file, in this case 3 APE tags inserted into the middle of a previous Lyrics3 tag, most likely by an APE tagger that is not aware of how to handle Lyrics3 and ended up corrupting both Lyrics3 and APE tags.
Fixed in 6a3714a35afb021e9049288ada18f726c3f6a860
hisorhers wrote:c1bf56f6a5a127ed9fa64bc9aedbb759cfacbee2 - It seems to just load forever. If this problem can't be fixed (corrupt mp3) is there a way to 'cut' it with a timeout error rather than load indefinitely?
With demo.browse.php it does not have any problems loading (loaded in 0.275s, slightly slow because of a moderately-large cover art).

hisorhers
User
Posts: 10
Joined: Mon Sep 08, 2014 12:18 am
Are you a spambot?: no

Re: Range of PHP errors and warnings

Post by hisorhers » Mon Oct 27, 2014 1:28 am

Great, thanks. I've tested the c1bf56f6a5a127ed9fa64bc9aedbb759cfacbee2 with demo.browse.php, it still has the same problem. I will 'die' at different parts of the getid3 lib until I find out what's causing the problem and report back to you. Maybe it's my version of PHP causing the issue, PHP5.3.

hisorhers
User
Posts: 10
Joined: Mon Sep 08, 2014 12:18 am
Are you a spambot?: no

Re: Range of PHP errors and warnings

Post by hisorhers » Mon Oct 27, 2014 1:47 am

It's module.mp3.php, the getOnlyMPEGaudioInfo function. On line 1367, this fread slows it massively down but it loads still... the thing causing the forever loading is that while statement.

Do you have any ideas? It doesn't appear to be caused by the large album cover but the basic mpeg information.

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

Re: Range of PHP errors and warnings

Post by James Heinrich » Mon Oct 27, 2014 2:12 am

I don't see why it would. I didn't notice any errors, and the file is only 220kB so it can't really spend that long scanning even if it walks the whole file.

hisorhers
User
Posts: 10
Joined: Mon Sep 08, 2014 12:18 am
Are you a spambot?: no

Re: Range of PHP errors and warnings

Post by hisorhers » Mon Oct 27, 2014 7:52 pm

> the file is only 220kB

Maybe you are testing with the wrong file? It's 3,474,470 bytes.

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

Re: Range of PHP errors and warnings

Post by James Heinrich » Tue Oct 28, 2014 2:09 am

Indeed, but transfer errors out after 225,280 bytes. My best guess would be a hardware corruption, like bad section on the HDD.
6% [=> ] 225,280 --.-K/s eta 3m 36s
Which would also explain why getID3 hangs when trying to analyze it... it's your whole system hanging while trying to read the file.

hisorhers
User
Posts: 10
Joined: Mon Sep 08, 2014 12:18 am
Are you a spambot?: no

Re: Range of PHP errors and warnings

Post by hisorhers » Fri Nov 07, 2014 3:54 pm

You were right, thank you.

I have found a new problem, sha1 1720acb847b399dec4b230b0e71c2ff0c7d9f088 loads what appears to be the entire MP3 file inside the 'isrc' key (The tag fails to end after TIT2).

hisorhers
User
Posts: 10
Joined: Mon Sep 08, 2014 12:18 am
Are you a spambot?: no

Re: Range of PHP errors and warnings

Post by hisorhers » Fri Nov 07, 2014 4:09 pm

In viewtopic.php?f=21&t=1848#p5483 you tell us to use 'comments' instead of using 'APIC'/'PIC' directly, but you don't provide the datalength, dataoffset, image_mime, image_width & image_height with this method. For me to use these, should I instead use them directly or could getid3 add it to a newer version so when we upgrade to the latest version of getid3 we don't have to re-modify the script each time for this capability?

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

Re: Range of PHP errors and warnings

Post by James Heinrich » Fri Nov 07, 2014 4:44 pm

You got a messed up file there. Appears to have been originally tagged with ID3v2, then has some ID3v2.3 (I think) data stuffed into it, presumably by "PZTagEditor", which mucks up everything. getID3 does finish parsing the file correctly (as correctly as possible), just very slowly. I'll see if I can improve things, but I'm not sure how possible that is.

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

Re: Range of PHP errors and warnings

Post by James Heinrich » Fri Nov 07, 2014 6:01 pm

hisorhers wrote:In viewtopic.php?f=21&t=1848#p5483 you tell us to use 'comments' instead of using 'APIC'/'PIC' directly, but you don't provide the datalength, dataoffset, image_mime, image_width & image_height with this method. For me to use these, should I instead use them directly or could getid3 add it to a newer version so when we upgrade to the latest version of getid3 we don't have to re-modify the script each time for this capability?
Where available, this data is now copied to the [comments][picture] entry.
https://github.com/JamesHeinrich/getID3 ... cedff48d8d

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest