Merge pull request #8445 from radarhere/apply

This commit is contained in:
Hugo van Kemenade 2024-10-07 12:51:43 +03:00 committed by GitHub
commit 029ec8559b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}