mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-04 21:50:54 +03:00
Allow saving I;16B images as PNG
This commit is contained in:
parent
3c5324b07c
commit
2db354af43
|
@ -92,11 +92,11 @@ class TestFilePng:
|
||||||
assert im.format == "PNG"
|
assert im.format == "PNG"
|
||||||
assert im.get_format_mimetype() == "image/png"
|
assert im.get_format_mimetype() == "image/png"
|
||||||
|
|
||||||
for mode in ["1", "L", "P", "RGB", "I", "I;16"]:
|
for mode in ["1", "L", "P", "RGB", "I", "I;16", "I;16B"]:
|
||||||
im = hopper(mode)
|
im = hopper(mode)
|
||||||
im.save(test_file)
|
im.save(test_file)
|
||||||
with Image.open(test_file) as reloaded:
|
with Image.open(test_file) as reloaded:
|
||||||
if mode == "I;16":
|
if mode in ("I;16", "I;16B"):
|
||||||
reloaded = reloaded.convert(mode)
|
reloaded = reloaded.convert(mode)
|
||||||
assert_image_equal(reloaded, im)
|
assert_image_equal(reloaded, im)
|
||||||
|
|
||||||
|
|
|
@ -1042,6 +1042,7 @@ _OUTMODES = {
|
||||||
"LA": ("LA", b"\x08\x04"),
|
"LA": ("LA", b"\x08\x04"),
|
||||||
"I": ("I;16B", b"\x10\x00"),
|
"I": ("I;16B", b"\x10\x00"),
|
||||||
"I;16": ("I;16B", b"\x10\x00"),
|
"I;16": ("I;16B", b"\x10\x00"),
|
||||||
|
"I;16B": ("I;16B", b"\x10\x00"),
|
||||||
"P;1": ("P;1", b"\x01\x03"),
|
"P;1": ("P;1", b"\x01\x03"),
|
||||||
"P;2": ("P;2", b"\x02\x03"),
|
"P;2": ("P;2", b"\x02\x03"),
|
||||||
"P;4": ("P;4", b"\x04\x03"),
|
"P;4": ("P;4", b"\x04\x03"),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user