Closed theonelucas closed 3 years ago
Do you have gd
extension installed?
"GETID3_VERSION" => "1.9.20-202012091120" I'm currently using version
2.0.x-dev
.
Would it not make sense for the 2.0.x-dev branch to use 2.0.x version numbering to reduce confusion?
Seems this bug is from very old days. According to the documentation of getimagesize
:
Index 2 is one of the IMAGETYPE_XXX constants indicating the type of the image.
There even someone left a comment 16 years ago:
Note that, if you're going to be a good programmer and use named constatnts (IMAGETYPE_JPEG) rather than their values (2), you want to use the IMAGETYPE variants - IMAGETYPE_JPEG, IMAGETYPE GIF, IMAGETYPE_PNG, etc. For some reason, somebody made a horrible decision, and IMG_PNG is actually 4 in my version of PHP, while IMAGETYPE_PNG is 3. It took me a while to figure out why comparing the type against IMG_PNG was failing...
This works in version 1.x as a workaround was added for this IMG_JPG
variable
https://github.com/JamesHeinrich/getID3/blob/80c557835768de3bb76e45878c18774ad522aafc/getid3/getid3.php#L21-L23
but in version 2.x this workaround was apparently removed. Probably we need to use IMAGETYPE_JPEG
instead, because it works on all versions.
Do you have
gd
extension installed?
That indeed solved the problem. I read the requirement for the exif lib but did not see any mentions to GD, even though I could've assumed it would be required.
Would it not make sense for the 2.0.x-dev branch to use 2.0.x version numbering to reduce confusion?
I thought about this, but since version 2.x is in development status it doesn't have a specific version. I hope that someday we will switch to it as the main branch, since support for PHP 5.3 in GetID3 1.x in 2021 is rather doubtful.
While trying to parse any jpg file, the following error occurs:
Full
$info
object:I'm currently using version
2.0.x-dev
.I noticed this problem was apparently fixed almost 10 years ago by this commit, but still it happened with me.