We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ba97d1 commit 925fe51Copy full SHA for 925fe51
2 files changed
Tests/test_file_tiff.py
@@ -49,25 +49,10 @@ def test_sanity(self, tmp_path: Path) -> None:
49
assert im.size == (128, 128)
50
assert im.format == "TIFF"
51
52
- hopper("1").save(filename)
53
- with Image.open(filename):
54
- pass
55
-
56
- hopper("L").save(filename)
57
58
59
60
- hopper("P").save(filename)
61
62
63
64
- hopper("RGB").save(filename)
65
66
67
68
- hopper("I").save(filename)
69
70
+ for mode in ("1", "L", "P", "RGB", "I", "I;16", "I;16L"):
+ hopper(mode).save(filename)
+ with Image.open(filename):
+ pass
71
72
@pytest.mark.skipif(is_pypy(), reason="Requires CPython")
73
def test_unclosed_file(self) -> None:
src/PIL/TiffImagePlugin.py
@@ -1680,6 +1680,7 @@ def _setup(self) -> None:
1680
"PA": ("PA", II, 3, 1, (8, 8), 2),
1681
"I": ("I;32S", II, 1, 2, (32,), None),
1682
"I;16": ("I;16", II, 1, 1, (16,), None),
1683
+ "I;16L": ("I;16L", II, 1, 1, (16,), None),
1684
"F": ("F;32F", II, 1, 3, (32,), None),
1685
"RGB": ("RGB", II, 2, 1, (8, 8, 8), None),
1686
"RGBX": ("RGBX", II, 2, 1, (8, 8, 8, 8), 0),
@@ -1963,7 +1964,7 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:
1963
1964
# we're storing image byte order. So, if the rawmode
1965
# contains I;16, we need to convert from native to image
1966
# byte order.
- if im.mode in ("I;16B", "I;16"):
1967
+ if im.mode in ("I;16", "I;16B", "I;16L"):
1968
rawmode = "I;16N"
1969
1970
# Pass tags as sorted list so that the tags are set in a fixed order.
0 commit comments