From: Jason Woofenden Date: Fri, 6 Nov 2015 17:08:07 +0000 (-0500) Subject: convert_uploaded_image/gif_to_png handle animated gifs X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=7d52281d2cd7b6ac780596c3733a1e0c56a4102b convert_uploaded_image/gif_to_png handle animated gifs --- diff --git a/upload.php b/upload.php index 48a248f..b21af6f 100644 --- a/upload.php +++ b/upload.php @@ -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";