Added test for non-colormap 16-bit image

This commit is contained in:
Andrew Murray 2024-06-26 18:06:47 +10:00 committed by Yay295
parent 6ee41897e2
commit 6863c87c01
2 changed files with 8 additions and 0 deletions

BIN
Tests/images/rgba16.tga Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

View File

@ -81,6 +81,14 @@ def test_palette_depth_16(tmp_path: Path) -> None:
assert_image_equal_tofile(reloaded.convert("RGBA"), "Tests/images/p_16.png")
def test_rgba_16() -> None:
with Image.open("Tests/images/rgba16.tga") as im:
assert im.mode == "RGBA"
assert im.getpixel((0, 0)) == (172, 0, 255, 255)
assert im.getpixel((1, 0)) == (0, 255, 82, 0)
def test_id_field() -> None:
# tga file with id field
test_file = "Tests/images/tga_id_field.tga"