Does anyone know all the possible results for the 3rd value returned from PHP’s getimagesize() function? Example this code below will return:
$imageinfo['2'] = 2;for ajpgimage,$imageinfo['2'] = 3;for apngimage,$imageinfo['2'] = 0;for agifimage.
The numbers might not be correct above but you get the idea.
I can’t find on php.net or anywhere else a list of all possible results for the 3rd value.
$imageinfo = getimagesize($imageurl);
$image_type = $imageinfo['2'];
Execute this:
And then look for constants prefixed with IMAGETYPE_. On my PHP 5.3 installation I got these values:
As you can see Flash SWF are considered images, and actually
getimagesize()is able to read the width and height of a SWF object. To me it seemed like a curiosity when I first discovered it, that’s why mentioned it here.