mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Merge pull request #6080 from radarhere/gif_test
Test that n_frames and is_animated do not change GIF
This commit is contained in:
commit
b3599de6c9
|
@ -308,6 +308,22 @@ def test_n_frames():
|
||||||
assert im.is_animated == (n_frames != 1)
|
assert im.is_animated == (n_frames != 1)
|
||||||
|
|
||||||
|
|
||||||
|
def test_no_change():
|
||||||
|
# Test n_frames does not change the image
|
||||||
|
with Image.open("Tests/images/dispose_bgnd.gif") as im:
|
||||||
|
im.seek(1)
|
||||||
|
expected = im.copy()
|
||||||
|
assert im.n_frames == 5
|
||||||
|
assert_image_equal(im, expected)
|
||||||
|
|
||||||
|
# Test is_animated does not change the image
|
||||||
|
with Image.open("Tests/images/dispose_bgnd.gif") as im:
|
||||||
|
im.seek(3)
|
||||||
|
expected = im.copy()
|
||||||
|
assert im.is_animated
|
||||||
|
assert_image_equal(im, expected)
|
||||||
|
|
||||||
|
|
||||||
def test_eoferror():
|
def test_eoferror():
|
||||||
with Image.open(TEST_GIF) as im:
|
with Image.open(TEST_GIF) as im:
|
||||||
n_frames = im.n_frames
|
n_frames = im.n_frames
|
||||||
|
|
Loading…
Reference in New Issue
Block a user