mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-18 03:04:45 +03:00
allow frame durations of less than 10 milliseconds
This commit is contained in:
parent
9e0d8b20c9
commit
f71e0ec4bd
|
@ -187,7 +187,7 @@ class GifImageFile(ImageFile.ImageFile):
|
||||||
flags = i8(block[0])
|
flags = i8(block[0])
|
||||||
if flags & 1:
|
if flags & 1:
|
||||||
self.info["transparency"] = i8(block[3])
|
self.info["transparency"] = i8(block[3])
|
||||||
self.info["duration"] = i16(block[1:3]) * 10
|
self.info["duration"] = i16(block[1:3])
|
||||||
|
|
||||||
# disposal method - find the value of bits 4 - 6
|
# disposal method - find the value of bits 4 - 6
|
||||||
dispose_bits = 0b00011100 & flags
|
dispose_bits = 0b00011100 & flags
|
||||||
|
@ -448,7 +448,7 @@ def _get_local_header(fp, im, offset, flags):
|
||||||
transparent_color_exists = False
|
transparent_color_exists = False
|
||||||
|
|
||||||
if "duration" in im.encoderinfo:
|
if "duration" in im.encoderinfo:
|
||||||
duration = int(im.encoderinfo["duration"] / 10)
|
duration = int(im.encoderinfo["duration"])
|
||||||
else:
|
else:
|
||||||
duration = 0
|
duration = 0
|
||||||
if transparent_color_exists or duration != 0:
|
if transparent_color_exists or duration != 0:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user