mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-17 18:54:46 +03:00
simplify statements about setting duration when saving GIF
This commit is contained in:
parent
8f44fa4aec
commit
90ce8d219e
|
@ -361,11 +361,8 @@ def _save(im, fp, filename, save_all=False):
|
||||||
for im_frame in ImageSequence.Iterator(imSequence):
|
for im_frame in ImageSequence.Iterator(imSequence):
|
||||||
encoderinfo = im.encoderinfo.copy()
|
encoderinfo = im.encoderinfo.copy()
|
||||||
im_frame = _convert_mode(im_frame)
|
im_frame = _convert_mode(im_frame)
|
||||||
if duration is not None:
|
if isinstance(duration, list):
|
||||||
if not isinstance(duration, list):
|
encoderinfo["duration"] = duration[frame_count]
|
||||||
encoderinfo["duration"] = duration
|
|
||||||
else:
|
|
||||||
encoderinfo["duration"] = duration[frame_count]
|
|
||||||
frame_count += 1
|
frame_count += 1
|
||||||
|
|
||||||
# To specify duration, add the time in milliseconds to getdata(),
|
# To specify duration, add the time in milliseconds to getdata(),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user