From feeceb9ae629199b69361d698154076734e3902a Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 7 Oct 2024 15:34:28 +1100 Subject: [PATCH] Simplified code --- src/_imagingmorph.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/_imagingmorph.c b/src/_imagingmorph.c index 614dfbe7f..fc35107b5 100644 --- a/src/_imagingmorph.c +++ b/src/_imagingmorph.c @@ -62,11 +62,8 @@ apply(PyObject *self, PyObject *args) { width = imgin->xsize; height = imgin->ysize; - if (imgin->type != IMAGING_TYPE_UINT8 || imgin->bands != 1) { - PyErr_SetString(PyExc_RuntimeError, "Unsupported image type"); - return NULL; - } - if (imgout->type != IMAGING_TYPE_UINT8 || imgout->bands != 1) { + if (imgin->type != IMAGING_TYPE_UINT8 || imgin->bands != 1 || + imgout->type != IMAGING_TYPE_UINT8 || imgout->bands != 1) { PyErr_SetString(PyExc_RuntimeError, "Unsupported image type"); return NULL; }