mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-28 01:10:51 +01:00
Fix bug
This commit is contained in:
parent
934c00f488
commit
1d7de12281
@ -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->format == 'gif' && ($config['thumb_ext'] == 'gif' || $config['thumb_ext'] == '') && $config['thumb_keep_animation_frames'] > 1) {
|
||||||
if ($this->gifsicle) {
|
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->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!');
|
error('Failed to resize image!');
|
||||||
} else {
|
} else {
|
||||||
if (shell_exec('convert ' . sprintf($config['convert_args'], $this->width, $this->height) . ' ' .
|
if (trim(shell_exec('convert ' . sprintf($config['convert_args'], $this->width, $this->height) . ' ' .
|
||||||
escapeshellarg($this->src . '') . " " . escapeshellarg($this->temp)) || !file_exists($this->temp))
|
escapeshellarg($this->src . '') . " " . escapeshellarg($this->temp)) . ';echo $?') !== '0' || !file_exists($this->temp))
|
||||||
error('Failed to resize image!');
|
error('Failed to resize image!');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (shell_exec('convert -flatten ' . sprintf($config['convert_args'], $this->width, $this->height) .
|
if (trim(shell_exec('convert -flatten ' . sprintf($config['convert_args'], $this->width, $this->height) . ' ' .
|
||||||
escapeshellarg($this->src . '[0]') . " " . escapeshellarg($this->temp)) || !file_exists($this->temp))
|
escapeshellarg($this->src . '[0]') . " " . escapeshellarg($this->temp) . ';echo $?')) !== '0' || !file_exists($this->temp))
|
||||||
error('Failed to resize image!');
|
error('Failed to resize image!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user