Skip to content

Commit

Permalink
Added test BC4 TYPELESS image
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 4, 2023
1 parent c1b3c34 commit 0e36c14
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Binary file added Tests/images/bc4_typeless.dds
Binary file not shown.
13 changes: 11 additions & 2 deletions Tests/test_file_dds.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
TEST_FILE_DXT5 = "Tests/images/dxt5-argb-8bbp-interpolatedalpha_MipMaps-1.dds"
TEST_FILE_ATI1 = "Tests/images/ati1.dds"
TEST_FILE_ATI2 = "Tests/images/ati2.dds"
TEST_FILE_DX10_BC4_TYPELESS = "Tests/images/bc4_typeless.dds"
TEST_FILE_DX10_BC4_UNORM = "Tests/images/bc4_unorm.dds"
TEST_FILE_DX10_BC5_TYPELESS = "Tests/images/bc5_typeless.dds"
TEST_FILE_DX10_BC5_UNORM = "Tests/images/bc5_unorm.dds"
Expand Down Expand Up @@ -83,10 +84,18 @@ def test_sanity_ati1():
assert_image_equal_tofile(im, TEST_FILE_ATI1.replace(".dds", ".png"))


def test_dx10_bc4():
@pytest.mark.parametrize(
"image_path",
(
TEST_FILE_DX10_BC4_UNORM,
# hexeditted to be typeless
TEST_FILE_DX10_BC4_TYPELESS,
),
)
def test_dx10_bc4(image_path):
"""Check DX10 BC4 images can be opened"""

with Image.open(TEST_FILE_DX10_BC4_UNORM) as im:
with Image.open(image_path) as im:
im.load()

assert im.format == "DDS"
Expand Down

0 comments on commit 0e36c14

Please sign in to comment.