diff options
-rw-r--r-- | it.class | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -512,8 +512,6 @@ static function _exec_quotevalue($value) */ static function imageconvert($p) { - $result = false; - if (!(($imagetype = @exif_imagetype($p['in'])) && ($type = image_type_to_extension($imagetype, false)))) { if (@get_class(it_xml::create(fopen($p['in'], "r"), array('prefix' => "_imageconvert_", 'safety' => 0))) == "_imageconvert_svg") @@ -527,9 +525,13 @@ static function imageconvert($p) $p['-opts'] = array('-thumbnail' => $p['size']) + (array)$p['-opts']; if (in_array($type, explode(',', $p['types']))) # Valid type? - $result = it::exec("convert 2>&1 -flatten -quality 75 {-opts} {in} {type}:{out}", $p) === ""; + { + $cmdoutput = it::exec('convert 2>&1 -flatten -quality 75 {-opts} {in} {type}:{out} || echo "SHELL ERROR $?"', $p); + if (it::match('SHELL ERROR 139', $cmdoutput)) # segmentation fault + copy($p['in'], "/tmp/imageconvert.segfault.in"); + } - return $result; + return $cmdoutput === ""; } |