Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions Tests/test_file_blp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
from PIL import BlpImagePlugin, Image

from .helper import (
assert_image_equal,
assert_image_equal_tofile,
assert_image_similar,
assert_image_similar_tofile,
hopper,
)

Expand Down Expand Up @@ -52,18 +51,16 @@ def test_save(tmp_path: Path) -> None:
im = hopper("P")
im.save(f, blp_version=version)

with Image.open(f) as reloaded:
assert_image_equal(im.convert("RGB"), reloaded)
assert_image_equal_tofile(im.convert("RGB"), f)

with Image.open("Tests/images/transparent.png") as im:
f = tmp_path / "temp.blp"
im.convert("P").save(f, blp_version=version)

with Image.open(f) as reloaded:
assert_image_similar(im, reloaded, 8)
assert_image_similar_tofile(im, f, 8)

im = hopper()
with pytest.raises(ValueError):
with pytest.raises(ValueError, match="Unsupported BLP image mode"):
im.save(f)


Expand Down
Loading