note 14278 added to function.getimagesize.php
| From: | php-general at lists dot php dot net | Date: | Tue, 24 Jul 2001 23:49:40 +0000 |
| Subject: | note 14278 added to function.getimagesize.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15799@lists.php.net to get a copy of this message | ||
getImageSize() fails for some JPEGs saved by digital cameras -- it returns NULL instead of an array.
The only workaround I've found is to use the
identify binary from the ImageMagick
distribution, whenever getImageSize() fails.
identify returns a string of data such as: "DSC00021.JPG[1] 640x480 DirectClass 88kb JPEG
1s" which can be parsed for size and type data.
http://www.php.net/manual/en/function.getimagesize.php