Skip to content

Commit e6ddb98

Browse files
Yay295radarhere
andcommitted
reorder "I;16" endianness check
Co-authored-by: Andrew Murray <[email protected]>
1 parent b22d22e commit e6ddb98

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/_imaging.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,17 +1574,16 @@ if (PySequence_Check(op)) { \
15741574
// 0 = none, 1 = little, 2 = big
15751575
int endian = 0;
15761576
if (strncmp(image->mode, "I;16", 4) == 0) {
1577-
if (strcmp(image->mode, "I;16") == 0 || strcmp(image->mode, "I;16L") == 0) {
1578-
endian = 1;
1579-
} else if (strcmp(image->mode, "I;16B") == 0) {
1580-
endian = 2;
1581-
} else {
1582-
// native endianness
1577+
if (strcmp(image->mode, "I;16N") == 0) {
15831578
#ifdef WORDS_BIGENDIAN
15841579
endian = 2;
15851580
#else
15861581
endian = 1;
15871582
#endif
1583+
} else if (strcmp(image->mode, "I;16B") == 0) {
1584+
endian = 2;
1585+
} else {
1586+
endian = 1;
15881587
}
15891588
}
15901589
double value;

0 commit comments

Comments
 (0)