From b3ce83e9cb53ac9de13463f37645a01bad7ca9da Mon Sep 17 00:00:00 2001 From: patdenice Date: Sat, 17 Dec 2011 17:45:49 +0000 Subject: bug:2537 Thumbnail creation may crash on some servers git-svn-id: http://piwigo.org/svn/trunk@12756 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/image.class.php | 8 ++++---- 1 file 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); } } -- cgit v1.2.3