From eff667a8614ba3b567684597795924387c8cbaaa Mon Sep 17 00:00:00 2001 From: wiredfool Date: Fri, 23 May 2025 10:22:59 +0100 Subject: [PATCH] Mark the image read-only in the C layer if it's created from a read only buffer --- src/map.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/map.c b/src/map.c index c66702981..9a3144ab9 100644 --- a/src/map.c +++ b/src/map.c @@ -137,6 +137,7 @@ PyImaging_MapBuffer(PyObject *self, PyObject *args) { } } + im->read_only = view.readonly; im->destroy = mapping_destroy_buffer; Py_INCREF(target);