mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
extents are not used by map_buffer
This commit is contained in:
parent
4b626ea14a
commit
6a7ac38c6c
|
@ -2634,7 +2634,7 @@ def frombuffer(mode, size, data, decoder_name="raw", *args):
|
||||||
args = mode, 0, 1
|
args = mode, 0, 1
|
||||||
if args[0] in _MAPMODES:
|
if args[0] in _MAPMODES:
|
||||||
im = new(mode, (1, 1))
|
im = new(mode, (1, 1))
|
||||||
im = im._new(core.map_buffer(data, size, decoder_name, None, 0, args))
|
im = im._new(core.map_buffer(data, size, decoder_name, 0, args))
|
||||||
im.readonly = 1
|
im.readonly = 1
|
||||||
return im
|
return im
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ class ImageFile(Image.Image):
|
||||||
fp.fileno(), 0, access=mmap.ACCESS_READ
|
fp.fileno(), 0, access=mmap.ACCESS_READ
|
||||||
)
|
)
|
||||||
self.im = Image.core.map_buffer(
|
self.im = Image.core.map_buffer(
|
||||||
self.map, self.size, decoder_name, extents, offset, args
|
self.map, self.size, decoder_name, offset, args
|
||||||
)
|
)
|
||||||
readonly = 1
|
readonly = 1
|
||||||
# After trashing self.im,
|
# After trashing self.im,
|
||||||
|
|
|
@ -313,14 +313,13 @@ PyImaging_MapBuffer(PyObject* self, PyObject* args)
|
||||||
Py_buffer view;
|
Py_buffer view;
|
||||||
char* mode;
|
char* mode;
|
||||||
char* codec;
|
char* codec;
|
||||||
PyObject* bbox;
|
|
||||||
Py_ssize_t offset;
|
Py_ssize_t offset;
|
||||||
int xsize, ysize;
|
int xsize, ysize;
|
||||||
int stride;
|
int stride;
|
||||||
int ystep;
|
int ystep;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "O(ii)sOn(sii)", &target, &xsize, &ysize,
|
if (!PyArg_ParseTuple(args, "O(ii)sn(sii)", &target, &xsize, &ysize,
|
||||||
&codec, &bbox, &offset, &mode, &stride, &ystep))
|
&codec, &offset, &mode, &stride, &ystep))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!PyImaging_CheckBuffer(target)) {
|
if (!PyImaging_CheckBuffer(target)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user