Skip to content

Commit

Permalink
Added test for non-colormap 16-bit image
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere authored and Yay295 committed Jun 26, 2024
1 parent 6ee4189 commit 6863c87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Binary file added Tests/images/rgba16.tga
Binary file not shown.
8 changes: 8 additions & 0 deletions Tests/test_file_tga.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6863c87

Please sign in to comment.