mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-02 23:13:40 +03:00
Test missing frame size
This commit is contained in:
parent
e946c7b14a
commit
5575c1d072
|
@ -1,5 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import io
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
@ -132,6 +133,15 @@ def test_eoferror() -> None:
|
||||||
im.seek(n_frames - 1)
|
im.seek(n_frames - 1)
|
||||||
|
|
||||||
|
|
||||||
|
def test_missing_frame_size() -> None:
|
||||||
|
with open(animated_test_file, "rb") as fp:
|
||||||
|
data = fp.read()
|
||||||
|
data = data[:6188]
|
||||||
|
with Image.open(io.BytesIO(data)) as im:
|
||||||
|
with pytest.raises(EOFError, match="missing frame size"):
|
||||||
|
im.seek(1)
|
||||||
|
|
||||||
|
|
||||||
def test_seek_tell() -> None:
|
def test_seek_tell() -> None:
|
||||||
with Image.open(animated_test_file) as im:
|
with Image.open(animated_test_file) as im:
|
||||||
layer_number = im.tell()
|
layer_number = im.tell()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user