Resolved error for comment extension with zero subblocks

This commit is contained in:
Andrew Murray 2018-11-27 21:09:28 +11:00
parent 080bfd3ee1
commit f1b2802eb1
3 changed files with 7 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -435,6 +435,11 @@ class TestFileGif(PillowTestCase):
self.assertEqual(reread.info['comment'], im.info['comment'])
def test_zero_comment_subblocks(self):
im = Image.open('Tests/images/hopper_zero_comment_subblocks.gif')
expected = Image.open(TEST_GIF)
self.assert_image_equal(im, expected)
def test_version(self):
out = self.tempfile('temp.gif')

View File

@ -202,6 +202,8 @@ class GifImageFile(ImageFile.ImageFile):
# comment extension
#
info["comment"] = block
if not block:
continue
elif i8(s) == 255:
#
# application extension