From 986c55ff646852573b95986b628e5ab133a2ed4a Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 17 Apr 2020 19:15:05 +1000 Subject: [PATCH 1/2] Initialise __loaded = 0, removed initialisation of __physical_frame --- src/PIL/WebPImagePlugin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PIL/WebPImagePlugin.py b/src/PIL/WebPImagePlugin.py index 011e10716..77a02e4b9 100644 --- a/src/PIL/WebPImagePlugin.py +++ b/src/PIL/WebPImagePlugin.py @@ -38,9 +38,8 @@ class WebPImageFile(ImageFile.ImageFile): format = "WEBP" format_description = "WebP image" - __loaded = -1 + __loaded = 0 __logical_frame = 0 - __physical_frame = 0 def _open(self): if not _webp.HAVE_WEBPANIM: From e52b8cefe16ce247696da943790dda005d8a85e6 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 17 Apr 2020 20:08:10 +1000 Subject: [PATCH 2/2] Skip test if webp is not available --- Tests/test_pickle.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/test_pickle.py b/Tests/test_pickle.py index a6652562c..4bf6d586a 100644 --- a/Tests/test_pickle.py +++ b/Tests/test_pickle.py @@ -84,6 +84,7 @@ def test_pickle_la_mode_with_palette(tmp_path): assert im == loaded_im +@skip_unless_feature("webp") def test_pickle_tell(): # Arrange image = Image.open("Tests/images/hopper.webp")