From 53cfd19a44b49da1603608b747facc4d374678b5 Mon Sep 17 00:00:00 2001 From: Riley Lahd Date: Thu, 14 Mar 2019 14:44:15 -0600 Subject: [PATCH] Check encoder info for disposal mode --- src/PIL/GifImagePlugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py index 13036b1b4..1171c1fe1 100644 --- a/src/PIL/GifImagePlugin.py +++ b/src/PIL/GifImagePlugin.py @@ -444,8 +444,8 @@ def _write_multiple_frames(im, fp, palette): if im_frames: # delta frame previous = im_frames[-1] - if "disposal" in im.encoderinfo \ - and im.encoderinfo["disposal"] == 2: + if "disposal" in encoderinfo \ + and encoderinfo["disposal"] == 2: base_image = background else: base_image = previous["im"] @@ -457,8 +457,8 @@ def _write_multiple_frames(im, fp, palette): delta = ImageChops.subtract_modulo( im_frame.convert('RGB'), base_image.convert('RGB')) bbox = delta.getbbox() - if not bbox and not ("disposal" in im.encoderinfo - and im.encoderinfo["disposal"] == 2): + if not bbox and not ("disposal" in encoderinfo + and encoderinfo["disposal"] == 2): # This frame is identical to the previous frame if duration: previous['encoderinfo']['duration'] += \