Update GifImagePlugin.py

This commit is contained in:
djy0 2019-08-02 08:54:04 +08:00 committed by Andrew Murray
parent 8696f06fbe
commit fcaf27d51c

View File

@ -472,6 +472,10 @@ def _write_multiple_frames(im, fp, palette):
else:
bbox = None
im_frames.append({"im": im_frame, "bbox": bbox, "encoderinfo": encoderinfo})
# see: https://github.com/python-pillow/Pillow/issues/4002
if len(im_frames) == 1 and 'duration' in im_frames[0]['encoderinfo']:
im.encoderinfo['duration'] = im_frames[0]['encoderinfo']['duration']
if len(im_frames) > 1:
for frame_data in im_frames: