Check against mode 1 instead of input mode for Chops.c

This commit is contained in:
wiredfool 2025-10-10 12:31:15 +01:00
parent 2b4c7c011e
commit bd6e70fccd

View File

@ -64,7 +64,8 @@ create(Imaging im1, Imaging im2, const ModeID mode) {
int xsize, ysize; int xsize, ysize;
if (!im1 || !im2 || im1->type != IMAGING_TYPE_UINT8 || if (!im1 || !im2 || im1->type != IMAGING_TYPE_UINT8 ||
(mode != IMAGING_MODE_UNKNOWN && (im1->mode != mode || im2->mode != mode))) { (mode != IMAGING_MODE_UNKNOWN &&
(im1->mode != IMAGING_MODE_1 || im2->mode != IMAGING_MODE_1))) {
return (Imaging)ImagingError_ModeError(); return (Imaging)ImagingError_ModeError();
} }
if (im1->type != im2->type || im1->bands != im2->bands) { if (im1->type != im2->type || im1->bands != im2->bands) {