mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-23 23:30:34 +03:00
Test RGBX raw mode
This commit is contained in:
parent
4b7e75be2d
commit
5d40e6aead
|
@ -72,6 +72,22 @@ def test_unsupported_file_type() -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(
|
||||||
|
not os.path.exists(EXTRA_DIR), reason="Extra image files not installed"
|
||||||
|
)
|
||||||
|
def test_rgbx() -> None:
|
||||||
|
with open(os.path.join(EXTRA_DIR, "32bpp.ras"), "rb") as fp:
|
||||||
|
data = fp.read()
|
||||||
|
|
||||||
|
# Set file type to 3
|
||||||
|
data = data[:20] + _binary.o32be(3) + data[24:]
|
||||||
|
|
||||||
|
with Image.open(io.BytesIO(data)) as im:
|
||||||
|
r, g, b = im.split()
|
||||||
|
im = Image.merge("RGB", (b, g, r))
|
||||||
|
assert_image_equal_tofile(im, os.path.join(EXTRA_DIR, "32bpp.png"))
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(
|
@pytest.mark.skipif(
|
||||||
not os.path.exists(EXTRA_DIR), reason="Extra image files not installed"
|
not os.path.exists(EXTRA_DIR), reason="Extra image files not installed"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user