From f826dc37d1565a71b5ee916474afa4822457a968 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 25 Mar 2018 12:54:13 +0300 Subject: [PATCH] Fix incorrect image type checking in _imagingmorph module --- src/_imagingmorph.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_imagingmorph.c b/src/_imagingmorph.c index 73979f635..b700f8482 100644 --- a/src/_imagingmorph.c +++ b/src/_imagingmorph.c @@ -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;