From 9f28f12effe4ddce29f7ebd87d25b42a2867a72b Mon Sep 17 00:00:00 2001 From: Yay295 Date: Sun, 21 Apr 2024 22:41:29 -0500 Subject: [PATCH] use mode structs in Resample.c --- src/libImaging/Resample.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libImaging/Resample.c b/src/libImaging/Resample.c index f5e386dc2..3ab43a895 100644 --- a/src/libImaging/Resample.c +++ b/src/libImaging/Resample.c @@ -470,9 +470,9 @@ ImagingResampleHorizontal_16bpc( double *k; int bigendian = 0; - if (strcmp(imIn->mode, "I;16N") == 0 + if (imIn->mode == IMAGING_MODE_I_16N #ifdef WORDS_BIGENDIAN - || strcmp(imIn->mode, "I;16B") == 0 + || imIn->mode == IMAGING_MODE_I_16B #endif ) { bigendian = 1; @@ -509,9 +509,9 @@ ImagingResampleVertical_16bpc( double *k; int bigendian = 0; - if (strcmp(imIn->mode, "I;16N") == 0 + if (imIn->mode == IMAGING_MODE_I_16N #ifdef WORDS_BIGENDIAN - || strcmp(imIn->mode, "I;16B") == 0 + || imIn->mode == IMAGING_MODE_I_16B #endif ) { bigendian = 1; @@ -646,12 +646,12 @@ ImagingResample(Imaging imIn, int xsize, int ysize, int filter, float box[4]) { ResampleFunction ResampleHorizontal; ResampleFunction ResampleVertical; - if (strcmp(imIn->mode, "P") == 0 || strcmp(imIn->mode, "1") == 0) { + if (imIn->mode == IMAGING_MODE_P || imIn->mode == IMAGING_MODE_1) { return (Imaging)ImagingError_ModeError(); } if (imIn->type == IMAGING_TYPE_SPECIAL) { - if (strncmp(imIn->mode, "I;16", 4) == 0) { + if (isModeI16(imIn->mode)) { ResampleHorizontal = ImagingResampleHorizontal_16bpc; ResampleVertical = ImagingResampleVertical_16bpc; } else {