Skip to content

Commit b08656e

Browse files
committed
Updated test image to avoid converting
1 parent 0466df0 commit b08656e

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

Tests/images/vtf_dxt1.png

920 Bytes
Loading

Tests/test_file_vtf.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,13 @@ def test_get_texture_size(
8989
],
9090
)
9191
def test_vtf_read(file_path: str, expected_mode: str, epsilon: int) -> None:
92-
with Image.open(file_path) as f:
93-
assert f.mode == expected_mode
94-
with Image.open(file_path.replace(".vtf", ".png")) as e:
95-
converted_e = e.convert(expected_mode)
96-
if epsilon:
97-
assert_image_similar(f, converted_e, epsilon)
98-
else:
99-
assert_image_equal(f, converted_e)
92+
with Image.open(file_path) as im:
93+
assert im.mode == expected_mode
94+
with Image.open(file_path.replace(".vtf", ".png")) as expected:
95+
if epsilon:
96+
assert_image_similar(im, expected, epsilon)
97+
else:
98+
assert_image_equal(im, expected)
10099

101100

102101
def test_invalid_file() -> None:
@@ -146,8 +145,6 @@ def test_vtf_save(
146145
with Image.open(file_path) as im:
147146
out = tmp_path / "tmp.vtf"
148147
im.save(out, pixel_format=pixel_format, version=version)
149-
if pixel_format == VtfPF.DXT1:
150-
im = im.convert("RGBA")
151148
with Image.open(out) as expected:
152149
assert expected.mode == expected_mode
153150
if epsilon:

0 commit comments

Comments
 (0)