mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-22 21:24:46 +03:00
APNG - use previous frame with dispose action to draw the next frame.
APNG defines a dispose operation after each frame. This dispose should be done before drawing the next frame. PNG code stores this frame on _prev_im but it is not used to draw the next frame. This change use the _prev_im as the base to draw the next frame.
This commit is contained in:
parent
78fd2749b1
commit
93e0f80a22
|
@ -868,6 +868,11 @@ class PngImageFile(ImageFile.ImageFile):
|
||||||
self.decoderconfig = self.decoderconfig + (1,)
|
self.decoderconfig = self.decoderconfig + (1,)
|
||||||
|
|
||||||
self.__idat = self.__prepare_idat # used by load_read()
|
self.__idat = self.__prepare_idat # used by load_read()
|
||||||
|
|
||||||
|
# Use prev_im as base image
|
||||||
|
if self.is_animated and self._prev_im:
|
||||||
|
self.im = self._prev_im.copy()
|
||||||
|
|
||||||
ImageFile.ImageFile.load_prepare(self)
|
ImageFile.ImageFile.load_prepare(self)
|
||||||
|
|
||||||
def load_read(self, read_bytes):
|
def load_read(self, read_bytes):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user