From 6863c87c0151c9330c4ef1db1bb9058b8d34f703 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 26 Jun 2024 18:06:47 +1000 Subject: [PATCH] Added test for non-colormap 16-bit image --- Tests/images/rgba16.tga | Bin 0 -> 48 bytes Tests/test_file_tga.py | 8 ++++++++ 2 files changed, 8 insertions(+) create mode 100644 Tests/images/rgba16.tga diff --git a/Tests/images/rgba16.tga b/Tests/images/rgba16.tga new file mode 100644 index 0000000000000000000000000000000000000000..3918647a23cf31628e0beb8a14084ef7383582a1 GIT binary patch literal 48 qcmZQzU}As)CI&_Z0S@_)SIsbykf2c4FwbC5e?Q#_H%}i|Jq7@4vIgk@ literal 0 HcmV?d00001 diff --git a/Tests/test_file_tga.py b/Tests/test_file_tga.py index 15c7bbdb8..a03a6a6e1 100644 --- a/Tests/test_file_tga.py +++ b/Tests/test_file_tga.py @@ -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"