mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Merge pull request #8231 from radarhere/ppm_i16
This commit is contained in:
commit
9308f11ebe
|
@ -95,7 +95,9 @@ def test_16bit_pgm_write(tmp_path: Path) -> None:
|
|||
with Image.open("Tests/images/16_bit_binary.pgm") as im:
|
||||
filename = str(tmp_path / "temp.pgm")
|
||||
im.save(filename, "PPM")
|
||||
assert_image_equal_tofile(im, filename)
|
||||
|
||||
im.convert("I;16").save(filename, "PPM")
|
||||
assert_image_equal_tofile(im, filename)
|
||||
|
||||
|
||||
|
|
|
@ -333,7 +333,7 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:
|
|||
rawmode, head = "1;I", b"P4"
|
||||
elif im.mode == "L":
|
||||
rawmode, head = "L", b"P5"
|
||||
elif im.mode == "I":
|
||||
elif im.mode in ("I", "I;16"):
|
||||
rawmode, head = "I;16B", b"P5"
|
||||
elif im.mode in ("RGB", "RGBA"):
|
||||
rawmode, head = "RGB", b"P6"
|
||||
|
|
Loading…
Reference in New Issue
Block a user