Commit 05926870 authored by Nigel McNie's avatar Nigel McNie

Prevent exif_imagetype producing read errors when the file is... "small".

See http://nz2.php.net/manual/en/function.exif-imagetype.php#79283 for
all the "frivolaties".
Signed-off-by: default avatarNigel McNie <nigel@catalyst.net.nz>
parent 20ab9122
......@@ -360,7 +360,9 @@ function is_image_type($type) {
function is_image_file($path) {
if (function_exists('exif_imagetype')) {
// exif_imagetype is faster
if (!$type = exif_imagetype($path)) {
// surpressing errors because exif_imagetype spews "read error!" to the logs on small files
// http://nz.php.net/manual/en/function.exif-imagetype.php#79283
if (!$type = @exif_imagetype($path)) {
return false;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment