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:
Steve Mc Gregor 2020-11-29 20:38:48 -08:00
parent 78fd2749b1
commit 93e0f80a22
No known key found for this signature in database
GPG Key ID: 11EEA21E017A5CAC

View File

@ -868,6 +868,11 @@ class PngImageFile(ImageFile.ImageFile):
self.decoderconfig = self.decoderconfig + (1,)
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)
def load_read(self, read_bytes):