Read 16-bit McIdas images into I;16B mode to allow for memory mapping by radarhere · Pull Request #9046 · python-pillow/Pillow

Skip to content

Navigation Menu

Sign in

Appearance settings

Conversation

@radarhere

# FIXME: add memory map support
mode = "I"
rawmode = "I;16B"

This FIXME can be resolved by changing the mode to match the rawmode.

# raw modes that may be memory mapped. NOTE: if you change this, you
# may have to modify the stride calculation in map.c too!
_MAPMODES = ("L", "P", "RGBX", "RGBA", "CMYK", "I;16", "I;16L", "I;16B")
if (
decoder_name == "raw"
and isinstance(args, tuple)
and len(args) >= 3
and args[0] == self.mode
and args[0] in Image._MAPMODES
):
try:
# use mmap, if possible

2 participants

@radarhere @hugovk