JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
convert_uploaded_image/gif_to_png handle animated gifs
authorJason Woofenden <jason@jasonwoof.com>
Fri, 6 Nov 2015 17:08:07 +0000 (12:08 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Fri, 6 Nov 2015 17:08:07 +0000 (12:08 -0500)
upload.php

index 48a248f..b21af6f 100644 (file)
@@ -238,7 +238,7 @@ function gif_to_png($filename, $new_filename = 'just change extension') {
                $new_filename .= '.png';
        }
 
-       imagemagick_convert($filename, $new_filename, "-colorspace sRGB", 'GIF to PNG conversion');
+       imagemagick_convert($filename.'[0]', $new_filename, "-colorspace sRGB", 'GIF to PNG conversion');
 
        unlink($filename);
        return $new_filename;
@@ -410,7 +410,7 @@ function convert_uploaded_image($key, $path, $image_width = 0, $image_height = 0
        if($image_width > 0 && $image_height > 0) {
                $convert_params .= " -geometry ${image_width}x$image_height";
        }
-       imagemagick_convert($tmp_filename, $filename, $convert_params);
+       imagemagick_convert($tmp_filename.'[0]', $filename, $convert_params);
        unlink($tmp_filename);
        list($w, $h) = image_w_h_or_die($filename);
        $ret = "$filename $w $h";