Better error handling/displaying with $config['debug'] and $config['verbose_errors']

This commit is contained in:
Michael Foster 2013-08-03 00:22:28 -04:00
parent 62f8ea4813
commit 1d37e81ade
5 changed files with 49 additions and 19 deletions

View file

@ -287,16 +287,16 @@ class ImageConvert extends ImageBase {
if (trim($error = shell_exec("gifsicle --unoptimize -O2 --resize {$this->width}x{$this->height} < " .
escapeshellarg($this->src . '') . " \"#0-{$config['thumb_keep_animation_frames']}\" > " .
escapeshellarg($this->temp) . '2>&1 &&echo $?') !== '0') || !file_exists($this->temp))
error($error);
error('Failed to resize image!', null, $error);
} else {
if (trim($error = shell_exec('convert ' . sprintf($config['convert_args'], '', $this->width, $this->height) . ' ' .
if (trim($error = shell_exec('aconvert ' . sprintf($config['convert_args'], '', $this->width, $this->height) . ' ' .
escapeshellarg($this->src) . ' ' . escapeshellarg($this->temp) . ' 2>&1 &&echo $?')) !== '0' || !file_exists($this->temp))
error($error);
error('Failed to resize image!', null, $error);
}
} else {
if (trim($error = shell_exec('convert ' . sprintf($config['convert_args'], '-flatten', $this->width, $this->height) . ' ' .
if (trim($error = shell_exec('aconvert ' . sprintf($config['convert_args'], '-flatten', $this->width, $this->height) . ' ' .
escapeshellarg($this->src . '[0]') . " " . escapeshellarg($this->temp) . ' 2>&1 &&echo $?')) !== '0' || !file_exists($this->temp))
error($error);
error('Failed to resize image!', null, $error);
}
}
}