diff options
| author | Michael Save <savetheinternet@tinyboard.org> | 2012-03-17 11:55:16 +1100 |
|---|---|---|
| committer | Michael Save <savetheinternet@tinyboard.org> | 2012-03-17 11:55:16 +1100 |
| commit | b82e3a814a35fdc2dc19a83a104623f4dd429c51 (patch) | |
| tree | 8dd0cd2139492c1fe7c6e36299b75036fed2c0d5 | |
| parent | 6db45d4c3d5182a11c53526ac0d416fa3bf3556e (diff) | |
Thumbnail the first frame only.
| -rw-r--r-- | inc/image.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/inc/image.php b/inc/image.php index 45a7df18..13b24169 100644 --- a/inc/image.php +++ b/inc/image.php @@ -13,8 +13,10 @@ $this->src = $src; $this->format = $format; - if($config['imagick']) { - $classname = $config['imagick_convert'] ? 'ImageConvert' : 'ImageImagick'; + if($config['thumb_method'] == 'imagick') { + $classname = 'ImageImagick'; + } elseif($config['thumb_method'] == 'convert') { + $classname = 'ImageConvert'; } else { $classname = 'Image' . strtoupper($this->format); if(!class_exists($classname)) { @@ -38,8 +40,10 @@ public function resize($extension, $max_width, $max_height) { global $config; - if($config['imagick']) { - $classname = $config['imagick_convert'] ? 'ImageConvert' : 'ImageImagick'; + if($config['thumb_method'] == 'imagick') { + $classname = 'ImageImagick'; + } elseif($config['thumb_method'] == 'convert') { + $classname = 'ImageConvert'; } else { $classname = 'Image' . strtoupper($extension); if(!class_exists($classname)) { @@ -242,7 +246,7 @@ $quality = $config['thumb_quality'] * 10; - if(shell_exec("convert -flatten -filter Point -resize {$this->width}x{$this->height} -quality {$quality} " . escapeshellarg($this->src) . " " . escapeshellarg($this->temp))) + if(shell_exec("convert -flatten -filter Point -resize {$this->width}x{$this->height} -quality {$quality} " . escapeshellarg($this->src . '[0]') . " " . escapeshellarg($this->temp))) error('Failed to resize image!'); } } |
