From e88e90b8ede189221199c429340d3242fc9dc318 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 24 Aug 2015 21:56:23 +1000 Subject: [PATCH] Minor improvement, one less copy --- PIL/GifImagePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PIL/GifImagePlugin.py b/PIL/GifImagePlugin.py index bd45e2dbc..d78e55f1f 100644 --- a/PIL/GifImagePlugin.py +++ b/PIL/GifImagePlugin.py @@ -357,7 +357,7 @@ def _save(im, fp, filename, save_all=False): fp.write(s) else: # delta frame - delta = ImageChops.subtract_modulo(im_frame, previous) + delta = ImageChops.subtract_modulo(im_frame, previous.copy()) bbox = delta.getbbox() if bbox: @@ -368,7 +368,7 @@ def _save(im, fp, filename, save_all=False): else: # FIXME: what should we do in this case? pass - previous = im_frame.copy() + previous = im_frame else: header = getheader(im_out, palette, im.encoderinfo)[0] for s in header: