mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-28 21:13:41 +03:00
Fix incorrect image type checking in _imagingmorph module
This commit is contained in:
parent
9386a414fc
commit
f826dc37d1
|
@ -64,12 +64,12 @@ apply(PyObject *self, PyObject* args)
|
||||||
width = imgin->xsize;
|
width = imgin->xsize;
|
||||||
height = imgin->ysize;
|
height = imgin->ysize;
|
||||||
|
|
||||||
if (imgin->type != IMAGING_TYPE_UINT8 &&
|
if (imgin->type != IMAGING_TYPE_UINT8 ||
|
||||||
imgin->bands != 1) {
|
imgin->bands != 1) {
|
||||||
PyErr_SetString(PyExc_RuntimeError, "Unsupported image type");
|
PyErr_SetString(PyExc_RuntimeError, "Unsupported image type");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (imgout->type != IMAGING_TYPE_UINT8 &&
|
if (imgout->type != IMAGING_TYPE_UINT8 ||
|
||||||
imgout->bands != 1) {
|
imgout->bands != 1) {
|
||||||
PyErr_SetString(PyExc_RuntimeError, "Unsupported image type");
|
PyErr_SetString(PyExc_RuntimeError, "Unsupported image type");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -167,7 +167,7 @@ match(PyObject *self, PyObject* args)
|
||||||
lut = PyBytes_AsString(py_lut);
|
lut = PyBytes_AsString(py_lut);
|
||||||
imgin = (Imaging) i0;
|
imgin = (Imaging) i0;
|
||||||
|
|
||||||
if (imgin->type != IMAGING_TYPE_UINT8 &&
|
if (imgin->type != IMAGING_TYPE_UINT8 ||
|
||||||
imgin->bands != 1) {
|
imgin->bands != 1) {
|
||||||
PyErr_SetString(PyExc_RuntimeError, "Unsupported image type");
|
PyErr_SetString(PyExc_RuntimeError, "Unsupported image type");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user