Merge pull request #6243 from radarhere/webp

Test invalid WebP background colors
This commit is contained in:
Hugo van Kemenade 2022-04-26 21:14:27 +03:00 committed by GitHub
commit 73646ad9d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,6 +185,17 @@ class TestFileWebp:
Image.open(blob).load()
Image.open(blob).load()
@pytest.mark.parametrize(
"background",
(0, (0,), (-1, 0, 1, 2), (253, 254, 255, 256)),
)
@skip_unless_feature("webp_anim")
def test_invalid_background(self, background, tmp_path):
temp_file = str(tmp_path / "temp.webp")
im = hopper()
with pytest.raises(OSError):
im.save(temp_file, save_all=True, append_images=[im], background=background)
@skip_unless_feature("webp_anim")
def test_background_from_gif(self, tmp_path):
# Save L mode GIF with background