From 4e958509be1ad3035c8c888c9d8234d1e83c8668 Mon Sep 17 00:00:00 2001 From: Junxiao Shi Date: Sat, 1 Jun 2024 14:34:24 +0000 Subject: [PATCH] XXX disable PyImaging_MapBuffer --- src/PIL/ImageFile.py | 3 +++ src/_imaging.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py index 69e7ee548..c8ad69f9b 100644 --- a/src/PIL/ImageFile.py +++ b/src/PIL/ImageFile.py @@ -206,6 +206,9 @@ class ImageFile(Image.Image): except AttributeError: seek = self.fp.seek + # XXX hack202406 disable unmodified code path + use_mmap = False + if use_mmap: # try memory mapping decoder_name, extents, offset, args = self.tile[0] diff --git a/src/_imaging.c b/src/_imaging.c index ddc8d2885..caf02029d 100644 --- a/src/_imaging.c +++ b/src/_imaging.c @@ -96,7 +96,8 @@ /* Configuration stuff. Feel free to undef things you don't need. */ #define WITH_IMAGECHOPS /* ImageChops support */ #define WITH_IMAGEDRAW /* ImageDraw support */ -#define WITH_MAPPING /* use memory mapping to read some file formats */ +// XXX hack202406 disable unmodified code path +// #define WITH_MAPPING /* use memory mapping to read some file formats */ #define WITH_IMAGEPATH /* ImagePath stuff */ #define WITH_ARROW /* arrow graphics stuff (experimental) */ #define WITH_EFFECTS /* special effects */