mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-17 08:42:13 +03:00
Added loop set to GifImagePlugin
This commit is contained in:
parent
e36e7dd7a2
commit
ecebedba7f
|
@ -340,7 +340,7 @@ def get_local_header(fp, im, offset=(0, 0)):
|
|||
else:
|
||||
transparent_color_exists = False
|
||||
|
||||
if 'duration' in im.encoderinfo:
|
||||
if "duration" in im.encoderinfo:
|
||||
duration = im.encoderinfo["duration"] / 10
|
||||
else:
|
||||
duration = 0
|
||||
|
@ -357,6 +357,16 @@ def get_local_header(fp, im, offset=(0, 0)):
|
|||
o8(transparency) + # transparency index
|
||||
o8(0))
|
||||
|
||||
if "loop" in im.encoderinfo:
|
||||
number_of_loops = im.encoderinfo["loop"]
|
||||
fp.write(b"!" +
|
||||
o8(255) + o8(11) + # extension intro
|
||||
b"NETSCAPE2.0" +
|
||||
o8(3) +
|
||||
o8(1) +
|
||||
o16(number_of_loops) + # number of loops
|
||||
o8(0))
|
||||
|
||||
flags = 0
|
||||
|
||||
if get_interlace(im):
|
||||
|
|
Loading…
Reference in New Issue
Block a user