From f71e0ec4bd3fb299db638155c3a33daccb23fe44 Mon Sep 17 00:00:00 2001 From: gboeing Date: Mon, 26 Dec 2016 17:07:34 -0800 Subject: [PATCH] allow frame durations of less than 10 milliseconds --- PIL/GifImagePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PIL/GifImagePlugin.py b/PIL/GifImagePlugin.py index 2775a00f1..21bcd57d7 100644 --- a/PIL/GifImagePlugin.py +++ b/PIL/GifImagePlugin.py @@ -187,7 +187,7 @@ class GifImageFile(ImageFile.ImageFile): flags = i8(block[0]) if flags & 1: 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 dispose_bits = 0b00011100 & flags @@ -448,7 +448,7 @@ def _get_local_header(fp, im, offset, flags): transparent_color_exists = False if "duration" in im.encoderinfo: - duration = int(im.encoderinfo["duration"] / 10) + duration = int(im.encoderinfo["duration"]) else: duration = 0 if transparent_color_exists or duration != 0: