Skip to content

Commit 4ac2403

Browse files
committed
Read 16-bit images into I;16B mode to allow for memory mapping
1 parent a370209 commit 4ac2403

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed
-1.37 MB
Binary file not shown.

Tests/test_file_mcidas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ def test_valid_file() -> None:
2727

2828
# Assert
2929
assert im.format == "MCIDAS"
30-
assert im.mode == "I"
30+
assert im.mode == "I;16B"
3131
assert im.size == (1800, 400)
3232
assert_image_equal_tofile(im, saved_file)

src/PIL/McIdasImagePlugin.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ def _open(self) -> None:
5050
if w[11] == 1:
5151
mode = rawmode = "L"
5252
elif w[11] == 2:
53-
# FIXME: add memory map support
54-
mode = "I"
55-
rawmode = "I;16B"
53+
mode = rawmode = "I;16B"
5654
elif w[11] == 4:
5755
# FIXME: add memory map support
5856
mode = "I"

0 commit comments

Comments
 (0)