Merge pull request #7701 from esoma/issue-7700

This commit is contained in:
Hugo van Kemenade 2024-01-11 14:05:16 +02:00 committed by GitHub
commit fc67ee29d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

View File

@ -689,3 +689,12 @@ def test_different_modes_in_later_frames(mode, default_image, duplicate, tmp_pat
)
with Image.open(test_file) as reloaded:
assert reloaded.mode == mode
def test_apng_repeated_seeks_give_correct_info() -> None:
with Image.open("Tests/images/apng/different_durations.png") as im:
for i in range(3):
im.seek(0)
assert im.info["duration"] == 4000
im.seek(1)
assert im.info["duration"] == 1000

View File

@ -378,7 +378,7 @@ class PngStream(ChunkStream):
}
def rewind(self):
self.im_info = self.rewind_state["info"]
self.im_info = self.rewind_state["info"].copy()
self.im_tile = self.rewind_state["tile"]
self._seq_num = self.rewind_state["seq_num"]