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.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index 522e638de..4394d3238 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -117,7 +117,14 @@ function guess_image_type($filename, $data = '') {
$body = $data['body'];
if ($body) {
$image = new Imagick();
- $image->readImageBlob($body);
+
+ try{
+ $image->readImageBlob($body);
+ } catch (\Exception $e) {
+ logger('Imagick readImageBlob() exception:' . print_r($e, true));
+ return $type;
+ }
+
$r = $image->identifyImage();
if ($r && is_array($r) && array_key_exists($r['mimetype'], $types))
$type = $r['mimetype'];