Skip to content

Commit

Permalink
Merge pull request #6455 from radarhere/gif_tile
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jul 25, 2022
2 parents ca4261f + 0844fb0 commit cd261ab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Binary file added Tests/images/comment_after_only_frame.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Tests/test_file_gif.py
Expand Up @@ -399,6 +399,11 @@ def test_no_change():
assert im.is_animated
assert_image_equal(im, expected)

with Image.open("Tests/images/comment_after_only_frame.gif") as im:
expected = Image.new("P", (1, 1))
assert not im.is_animated
assert_image_equal(im, expected)


def test_eoferror():
with Image.open(TEST_GIF) as im:
Expand Down
4 changes: 2 additions & 2 deletions src/PIL/GifImagePlugin.py
Expand Up @@ -185,8 +185,6 @@ def _seek(self, frame, update_image=True):
if not s or s == b";":
raise EOFError

self.tile = []

palette = None

info = {}
Expand Down Expand Up @@ -295,6 +293,8 @@ def _seek(self, frame, update_image=True):
if not update_image:
return

self.tile = []

if self.dispose:
self.im.paste(self.dispose, self.dispose_extent)

Expand Down

0 comments on commit cd261ab

Please sign in to comment.