Read 16-bit McIdas images into I;16B mode to allow for memory mapping (#9046)

This commit is contained in:
Hugo van Kemenade 2025-06-29 15:38:26 +03:00 committed by GitHub
commit a2fbd58f4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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"