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
This commit is contained in:
parent
8f4c1b657e
commit
7add07ee9f
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue