diff options
author | patdenice <patdenice@piwigo.org> | 2011-12-17 17:47:26 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2011-12-17 17:47:26 +0000 |
commit | 7add07ee9fe2ba8273c5334090975d68b6706fce (patch) | |
tree | 1017a252d85fa85ba6ee104c10b8f2a29e689a7a | |
parent | 8f4c1b657e4c3d207855beba4975c0ebfcc97b7b (diff) |
merge r12756 from trunk to branch 2.3
bug:2537
Thumbnail creation may crash on some servers
git-svn-id: http://piwigo.org/svn/branches/2.3@12757 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | admin/include/image.class.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/admin/include/image.class.php b/admin/include/image.class.php index b6c33e269..53a27b924 100644 --- a/admin/include/image.class.php +++ b/admin/include/image.class.php @@ -421,8 +421,8 @@ class image_ext_imagick implements imageInterface $this->imagickdir = $imagickdir; $command = $imagickdir.'identify -format "%wx%h" "'.realpath($source_filepath).'"'; - @exec($command, $returnarray, $returnvalue); - if($returnvalue or !preg_match('/^(\d+)x(\d+)$/', $returnarray[0], $match)) + @exec($command, $returnarray); + if(!is_array($returnarray) or empty($returnarray[0]) or !preg_match('/^(\d+)x(\d+)$/', $returnarray[0], $match)) { die("[External ImageMagick] Corrupt image"); } @@ -495,8 +495,8 @@ class image_ext_imagick implements imageInterface $dest = pathinfo($destination_filepath); $exec .= ' "'.realpath($dest['dirname']).'/'.$dest['basename'].'"'; - @exec($exec, $returnarray, $returnvalue); - return !$returnvalue; + @exec($exec, $returnarray); + return is_array($returnarray); } } |