Open pkieltyka opened 9 years ago
The current imagick implementation for gif resizing will flatten each layer, which creates a larger in filesize image, and is MUCH slower to resize because it effectively resizes more bytes per frame to generate the image.
this will load quickly because its already sized/cached -- but, try to change the size query param to 840x
or 730x .. pick something ... it will take over 2 seconds. And compare the filesize to the original image url: http://www.thisiscolossal.com/wp-content/uploads/2015/04/cine-1.gif
if you open the gif in an image editor, you will see the layers (frames), the subsequent frames are actually offset positions, layered on top of eachother. Other gifs do use full frames and a 0,0 offset.
The goal is to not have to flatten each frame, and try to keep the frames intact, and resize the respective layers etc. to get the final image.
Closed by https://github.com/pressly/imgry/pull/9?
https://github.com/pressly/imgry/blob/f7a2a8c41a15417782a37f4fbc3a90a2ef34c20f/imagick/imagick.go#L195-L199