From aed48a56b0bdb86dfe6fd7c824d163f2ea60b580 Mon Sep 17 00:00:00 2001 From: Yay295 Date: Tue, 13 Jun 2023 07:56:26 -0500 Subject: [PATCH] reorder "I;16" endianness check Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- src/_imaging.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/_imaging.c b/src/_imaging.c index 2fec920b5e4..5c28bd48575 100644 --- a/src/_imaging.c +++ b/src/_imaging.c @@ -1574,17 +1574,16 @@ if (PySequence_Check(op)) { \ // 0 = none, 1 = little, 2 = big int endian = 0; if (strncmp(image->mode, "I;16", 4) == 0) { - if (strcmp(image->mode, "I;16") == 0 || strcmp(image->mode, "I;16L") == 0) { - endian = 1; - } else if (strcmp(image->mode, "I;16B") == 0) { - endian = 2; - } else { - // native endianness + if (strcmp(image->mode, "I;16N") == 0) { #ifdef WORDS_BIGENDIAN endian = 2; #else endian = 1; #endif + } else if (strcmp(image->mode, "I;16B") == 0) { + endian = 2; + } else { + endian = 1; } } double value;