Fixed When ImageMagick set as the image processor, uploading animated gif avatars results in enormous file sizes for the resized gifs

thedude

Well-known member
Affected version
1.5.21
When ImageMagick is the image processor...

During the processing of an uploaded animated gif avatar, the frames of the gif get coalesced (Imagick::coalesceImages) but Imagick::deconstructImages doesn't get called after Imagick:: optimizeImageLayers gets called, resulting in a huge file size increase over the original (an order of magnitude from my personal testing on a few gifs).

I tested a fix by slipping
Code:
$this->_image = $this->_image->deconstructImages();
into XenForo_Image_ImageMagick_Pecl after the optimizeImageLayers call and the resulting gif was similar in size to the uploaded original.

References used when hunting down the issue:
http://php.net/manual/en/imagick.coalesceimages.php#110393
https://stackoverflow.com/questions...-animated-gifs-not-animated/19469380#19469380
 
Last edited:
Back
Top Bottom