diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py index c4db9790524..7302713cbe6 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -92,11 +92,11 @@ def test_sanity(self, tmp_path): 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) diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py index bfa8cb7ac66..35d1a4d7d0e 100644 --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -1042,6 +1042,7 @@ def getxmp(self): "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"),