diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-02 21:23:18 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-02 21:23:18 -0400 |
| commit | 1d7de12281f983cc8135abf9fcb00d9cd7e4972a (patch) | |
| tree | 85bc49f1ec622b122fc2a4d057adb7f23976646b /inc/image.php | |
| parent | 934c00f488dffa602bf6362de5ac9e1e625d2124 (diff) | |
Fix bug
Diffstat (limited to 'inc/image.php')
| -rw-r--r-- | inc/image.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/inc/image.php b/inc/image.php index 94267db2..34e8404f 100644 --- a/inc/image.php +++ b/inc/image.php @@ -284,18 +284,18 @@ class ImageConvert extends ImageBase { if ($this->format == 'gif' && ($config['thumb_ext'] == 'gif' || $config['thumb_ext'] == '') && $config['thumb_keep_animation_frames'] > 1) { if ($this->gifsicle) { - if (shell_exec("gifsicle --unoptimize -O2 --resize {$this->width}x{$this->height} < " . + if (trim(shell_exec("gifsicle --unoptimize -O2 --resize {$this->width}x{$this->height} < " . escapeshellarg($this->src . '') . " \"#0-{$config['thumb_keep_animation_frames']}\" > " . - escapeshellarg($this->temp)) || !file_exists($this->temp)) + escapeshellarg($this->temp) . ';echo $?' !== '0') || !file_exists($this->temp)) error('Failed to resize image!'); } else { - if (shell_exec('convert ' . sprintf($config['convert_args'], $this->width, $this->height) . ' ' . - escapeshellarg($this->src . '') . " " . escapeshellarg($this->temp)) || !file_exists($this->temp)) + if (trim(shell_exec('convert ' . sprintf($config['convert_args'], $this->width, $this->height) . ' ' . + escapeshellarg($this->src . '') . " " . escapeshellarg($this->temp)) . ';echo $?') !== '0' || !file_exists($this->temp)) error('Failed to resize image!'); } } else { - if (shell_exec('convert -flatten ' . sprintf($config['convert_args'], $this->width, $this->height) . - escapeshellarg($this->src . '[0]') . " " . escapeshellarg($this->temp)) || !file_exists($this->temp)) + if (trim(shell_exec('convert -flatten ' . sprintf($config['convert_args'], $this->width, $this->height) . ' ' . + escapeshellarg($this->src . '[0]') . " " . escapeshellarg($this->temp) . ';echo $?')) !== '0' || !file_exists($this->temp)) error('Failed to resize image!'); } } |
