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 Jul 2, 2023
1 parent 2cad76c commit aed48a5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/_imaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aed48a5

Please sign in to comment.