summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2010-03-15 16:53:12 +0000
committerUrban Müller2010-03-15 16:53:12 +0000
commit26d4c1ac3abd8638537d16506c7ec24101c59811 (patch)
tree26738f30934e1b682af65068730c67027c567786 /it.class
parent0718ca36ffc5764fbe5398a7a541a3740cdd9b0d (diff)
downloaditools-26d4c1ac3abd8638537d16506c7ec24101c59811.tar.gz
itools-26d4c1ac3abd8638537d16506c7ec24101c59811.tar.bz2
itools-26d4c1ac3abd8638537d16506c7ec24101c59811.zip
save segfault causing input
Diffstat (limited to 'it.class')
-rw-r--r--it.class10
1 files changed, 6 insertions, 4 deletions
diff --git a/it.class b/it.class
index 7a15e08..fa3eb29 100644
--- a/it.class
+++ b/it.class
@@ -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 === "";
}