Skip to content

Commit

Permalink
handle I;16 native endianness on big-endian machine
Browse files Browse the repository at this point in the history
  • Loading branch information
Yay295 committed Mar 11, 2024
1 parent 79c9b2b commit c56c890
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/_imaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,17 @@ if (PySequence_Check(op)) { \
int bigendian = 0;
if (image->type == IMAGING_TYPE_SPECIAL) {
// I;16*
bigendian = strcmp(image->mode, "I;16B") == 0;
if (strcmp(image->mode, "I;16N") == 0) {
#ifdef WORDS_BIGENDIAN
bigendian = 1;
#else
bigendian = 0;
#endif
} else if (strcmp(image->mode, "I;16B") == 0) {
bigendian = 1;
} else {
bigendian = 0;
}
}
for (i = x = y = 0; i < n; i++) {
set_value_to_item(seq, i);
Expand Down

0 comments on commit c56c890

Please sign in to comment.