mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +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;
|
||||
height = imgin->ysize;
|
||||
|
||||
if (imgin->type != IMAGING_TYPE_UINT8 &&
|
||||
if (imgin->type != IMAGING_TYPE_UINT8 ||
|
||||
imgin->bands != 1) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unsupported image type");
|
||||
return NULL;
|
||||
}
|
||||
if (imgout->type != IMAGING_TYPE_UINT8 &&
|
||||
if (imgout->type != IMAGING_TYPE_UINT8 ||
|
||||
imgout->bands != 1) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unsupported image type");
|
||||
return NULL;
|
||||
|
@ -167,7 +167,7 @@ match(PyObject *self, PyObject* args)
|
|||
lut = PyBytes_AsString(py_lut);
|
||||
imgin = (Imaging) i0;
|
||||
|
||||
if (imgin->type != IMAGING_TYPE_UINT8 &&
|
||||
if (imgin->type != IMAGING_TYPE_UINT8 ||
|
||||
imgin->bands != 1) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unsupported image type");
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue
Block a user