mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-29 02:03:25 +03:00
Initialise __physical_frame = 0 and add pickle roundtrip tell test
This commit is contained in:
parent
f589f8689f
commit
94751da23e
|
@ -82,3 +82,14 @@ def test_pickle_la_mode_with_palette(tmp_path):
|
||||||
|
|
||||||
im.mode = "PA"
|
im.mode = "PA"
|
||||||
assert im == loaded_im
|
assert im == loaded_im
|
||||||
|
|
||||||
|
|
||||||
|
def test_pickle_tell():
|
||||||
|
# Arrange
|
||||||
|
image = Image.open("Tests/images/hopper.webp")
|
||||||
|
|
||||||
|
# Act: roundtrip
|
||||||
|
unpickled_image = pickle.loads(pickle.dumps(image))
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
assert unpickled_image.tell() == 0
|
||||||
|
|
|
@ -40,6 +40,7 @@ class WebPImageFile(ImageFile.ImageFile):
|
||||||
format_description = "WebP image"
|
format_description = "WebP image"
|
||||||
__loaded = -1
|
__loaded = -1
|
||||||
__logical_frame = 0
|
__logical_frame = 0
|
||||||
|
__physical_frame = 0
|
||||||
|
|
||||||
def _open(self):
|
def _open(self):
|
||||||
if not _webp.HAVE_WEBPANIM:
|
if not _webp.HAVE_WEBPANIM:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user