Skip to content

Commit

Permalink
Fixed unpacking I;16B to I;16 on big endian
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 28, 2021
1 parent 4b7b07d commit aeb549e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Tests/test_file_png.py
Expand Up @@ -13,7 +13,6 @@
assert_image_equal,
assert_image_equal_tofile,
hopper,
is_big_endian,
is_win32,
mark_if_feature_version,
skip_unless_feature,
Expand Down Expand Up @@ -77,7 +76,6 @@ def get_chunks(self, filename):
png.crc(cid, s)
return chunks

@pytest.mark.xfail(is_big_endian(), reason="Fails on big-endian")
def test_sanity(self, tmp_path):

# internal version number
Expand Down
4 changes: 4 additions & 0 deletions src/libImaging/Pack.c
Expand Up @@ -656,7 +656,11 @@ static struct {

/* storage modes */
{"I;16", "I;16", 16, copy2},
#ifdef WORDS_BIGENDIAN
{"I;16", "I;16B", 16, packI16N_I16},
#else
{"I;16", "I;16B", 16, packI16N_I16B},
#endif
{"I;16B", "I;16B", 16, copy2},
{"I;16L", "I;16L", 16, copy2},
{"I;16", "I;16N", 16, packI16N_I16}, // LibTiff native->image endian.
Expand Down

0 comments on commit aeb549e

Please sign in to comment.