Coalesce animated gifs before resizing them. Fixes #264

In an animated gif, each frame is only the size it needs to be to cover the changed part of the image.
This is often much lower than the actual image size and the Wand image backend was using this incorrect size in its resizing calculations, causing all animated gifs to be resized incorrectly or not at all.

This commit calls ImageMagicks "MagickCoalesceImages" on the wand image. This resizes every frame to the full size of the image so the resizing calculations will work properly.
pull/277/head
Karl Hobley 2014-06-10 15:31:03 +01:00
rodzic b5586102ed
commit a6df469997
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -2,6 +2,7 @@ from __future__ import absolute_import
from .base import BaseImageBackend
from wand.image import Image
from wand.api import library
class WandBackend(BaseImageBackend):
@ -10,6 +11,7 @@ class WandBackend(BaseImageBackend):
def open_image(self, input_file):
image = Image(file=input_file)
image.wand = library.MagickCoalesceImages(image.wand)
return image
def save_image(self, image, output, format):