Skip to content

Commit

Permalink
reorder "I;16" endianness check
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
  • Loading branch information
Yay295 and radarhere committed Jun 13, 2023
1 parent b22d22e commit aae84f0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/_imaging.c
Expand Up @@ -1574,17 +1574,17 @@ 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;
Expand Down

0 comments on commit aae84f0

Please sign in to comment.