From 22f3a95e0e421de05a11633eac846df96a2a4768 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Thu, 1 Aug 2013 04:24:34 -0400 Subject: convert+gifscale didn't respect $config['thumb_keep_animation_frames'] --- inc/image.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'inc/image.php') diff --git a/inc/image.php b/inc/image.php index c39d7694..5910cb85 100644 --- a/inc/image.php +++ b/inc/image.php @@ -282,10 +282,13 @@ class ImageConvert extends ImageBase { $quality = $config['thumb_quality'] * 10; + $config['thumb_keep_animation_frames'] = (int) $config['thumb_keep_animation_frames']; + 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} < " . - escapeshellarg($this->src . '') . " > " . escapeshellarg($this->temp)) || !file_exists($this->temp)) + escapeshellarg($this->src . '') . " \"#0-{$config['thumb_keep_animation_frames']}\" > " . + escapeshellarg($this->temp)) || !file_exists($this->temp)) error('Failed to resize image!'); } else { if (shell_exec("convert -background transparent -filter Point -sample {$this->width}x{$this->height} +antialias -quality {$quality} " . -- cgit v1.3