mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-11 16:52:29 +03:00
Assert getpixel returns tuple
This commit is contained in:
parent
36a536ca1a
commit
4d153d66a1
|
@ -221,6 +221,7 @@ class TestFileAvif:
|
||||||
def test_background_from_gif(self, tmp_path: Path) -> None:
|
def test_background_from_gif(self, tmp_path: Path) -> None:
|
||||||
with Image.open("Tests/images/chi.gif") as im:
|
with Image.open("Tests/images/chi.gif") as im:
|
||||||
original_value = im.convert("RGB").getpixel((1, 1))
|
original_value = im.convert("RGB").getpixel((1, 1))
|
||||||
|
assert isinstance(original_value, tuple)
|
||||||
|
|
||||||
# Save as AVIF
|
# Save as AVIF
|
||||||
out_avif = tmp_path / "temp.avif"
|
out_avif = tmp_path / "temp.avif"
|
||||||
|
@ -233,6 +234,7 @@ class TestFileAvif:
|
||||||
|
|
||||||
with Image.open(out_gif) as reread:
|
with Image.open(out_gif) as reread:
|
||||||
reread_value = reread.convert("RGB").getpixel((1, 1))
|
reread_value = reread.convert("RGB").getpixel((1, 1))
|
||||||
|
assert isinstance(reread_value, tuple)
|
||||||
difference = sum([abs(original_value[i] - reread_value[i]) for i in range(3)])
|
difference = sum([abs(original_value[i] - reread_value[i]) for i in range(3)])
|
||||||
assert difference <= 3
|
assert difference <= 3
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user