Skip to content

Commit 0a70c24

Browse files
committed
Catch imagick image detection exceptions.
1 parent 41d5054 commit 0a70c24

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

server/php/UploadHandler.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*
3-
* jQuery File Upload Plugin PHP Class 7.0.0
3+
* jQuery File Upload Plugin PHP Class 7.0.1
44
* https://github.com/blueimp/jQuery-File-Upload
55
*
66
* Copyright 2010, Sebastian Tschan
@@ -901,12 +901,16 @@ protected function get_image_size($file_path) {
901901
if ($this->options['image_library']) {
902902
if (extension_loaded('imagick')) {
903903
$image = new Imagick();
904-
if (@$image->pingImage($file_path)) {
905-
$dimensions = array($image->getImageWidth(), $image->getImageHeight());
906-
$image->destroy();
907-
return $dimensions;
904+
try {
905+
if (@$image->pingImage($file_path)) {
906+
$dimensions = array($image->getImageWidth(), $image->getImageHeight());
907+
$image->destroy();
908+
return $dimensions;
909+
}
910+
return false;
911+
} catch (Exception $e) {
912+
error_log($e->getMessage());
908913
}
909-
return false;
910914
}
911915
if ($this->options['image_library'] === 2) {
912916
$cmd = $this->options['identify_bin'];

0 commit comments

Comments
 (0)