PHP exif_imagetype note #1
Windows users: If you get the fatal error "Fatal error: Call to undefined function exif_imagetype()", and you have enabled php_exif.dll, make sure you enable php_mbstring.dll.
You must put mbstring before exif in the php.ini, i.e.:
extension=php_mbstring.dll
extension=php_exif.dll
You can check whether this has worked by calling () and searching for exif.
PHP exif_imagetype note #2
If the function exif_imagetype() is not available,
By trial and error, it seems that a has to be 12 bytes or larger in order to avoid a "Read error!". Here's a work-around to avoid an error being thrown:
// exif_imagetype throws "Read error!" if file is too small
if (filesize($uploadfile) > 11)
$mimetype = exif_imagetype($uploadfile);
else
$mimetype = false;
PHP exif_imagetype note #4
Seems to give a 'Read error' warning if the>
PHP exif_imagetype note #5
libexif can also be used to parse image info out of>