diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-10-28 21:52:15 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-10-28 21:52:15 +0100 |
commit | a5f1fa3168d487655d4743f7680d36d80053b34f (patch) | |
tree | 9c671de7c5a1ebe24e91f3412923ac87742eedad /include | |
parent | 1375ed6aea765f16ff70606187d1458ee85ea6d9 (diff) | |
download | volse-hubzilla-a5f1fa3168d487655d4743f7680d36d80053b34f.tar.gz volse-hubzilla-a5f1fa3168d487655d4743f7680d36d80053b34f.tar.bz2 volse-hubzilla-a5f1fa3168d487655d4743f7680d36d80053b34f.zip |
re-enable pathinfo() check and try with getimagesize() if we have not got a result
Diffstat (limited to 'include')
-rw-r--r-- | include/photo/photo_driver.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index d439e9877..810e0cdc7 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -542,23 +542,22 @@ function guess_image_type($filename, $headers = '') { } } -/* if(is_null($type)) { $ext = pathinfo($filename, PATHINFO_EXTENSION); $ph = photo_factory(''); $types = $ph->supportedTypes(); - $type = "image/jpeg"; foreach ($types as $m=>$e){ 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; |