aboutsummaryrefslogtreecommitdiffstats
path: root/include/photo/photo_driver.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/photo/photo_driver.php')
-rw-r--r--include/photo/photo_driver.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index 5d61556ab..db98f7085 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -541,7 +541,7 @@ function guess_image_type($filename, $headers = '') {
// we aren't using imagick can find it
}
}
-
+/*
if(is_null($type)) {
$ext = pathinfo($filename, PATHINFO_EXTENSION);
$ph = photo_factory('');
@@ -551,6 +551,14 @@ function guess_image_type($filename, $headers = '') {
if ($ext==$e) $type = $m;
}
}
+*/
+ if(is_null($type)) {
+ $size = getimagesize($filename);
+ $ph = photo_factory('');
+ $types = $ph->supportedTypes();
+ $type = ((array_key_exists($size['mime'], $types)) ? $size['mime'] : 'image/jpeg');
+ }
+
}
logger('Photo: guess_image_type: type='.$type, LOGGER_DEBUG);
return $type;