Read 16-bit images into I;16B mode to allow for memory mapping

This commit is contained in:
Andrew Murray 2025-06-28 15:48:44 +10:00
parent a370209fea
commit 4ac2403532
3 changed files with 2 additions and 4 deletions

View File

@ -27,6 +27,6 @@ def test_valid_file() -> None:
# Assert
assert im.format == "MCIDAS"
assert im.mode == "I"
assert im.mode == "I;16B"
assert im.size == (1800, 400)
assert_image_equal_tofile(im, saved_file)

View File

@ -50,9 +50,7 @@ class McIdasImageFile(ImageFile.ImageFile):
if w[11] == 1:
mode = rawmode = "L"
elif w[11] == 2:
# FIXME: add memory map support
mode = "I"
rawmode = "I;16B"
mode = rawmode = "I;16B"
elif w[11] == 4:
# FIXME: add memory map support
mode = "I"