mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Merge pull request #7302 from radarhere/png_i16
Allow saving I;16B images as PNG
This commit is contained in:
commit
2d9c4e663f
|
@ -92,11 +92,11 @@ class TestFilePng:
|
|||
assert im.format == "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.save(test_file)
|
||||
with Image.open(test_file) as reloaded:
|
||||
if mode == "I;16":
|
||||
if mode in ("I;16", "I;16B"):
|
||||
reloaded = reloaded.convert(mode)
|
||||
assert_image_equal(reloaded, im)
|
||||
|
||||
|
|
|
@ -1042,6 +1042,7 @@ _OUTMODES = {
|
|||
"LA": ("LA", b"\x08\x04"),
|
||||
"I": ("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;2": ("P;2", b"\x02\x03"),
|
||||
"P;4": ("P;4", b"\x04\x03"),
|
||||
|
|
Loading…
Reference in New Issue
Block a user