-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix putdata() for I;16N on big-endian #7209
Conversation
Looks like the problem is here: Lines 1574 to 1590 in 706f8f6
The code is handling for endianness for "I;16B", but not "I;16N" on a big-endian machine. |
Why would we need to test that this runs without error for all image modes? |
aae84f0
to
e6ddb98
Compare
GitHub's suggestion auto-commit added an extra brace for some reason.
You're right. This will essentially be tested just by using it in other tests anyways. |
rebased on main |
Can this be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has a fix to src/_imaging.c
, let's rename the PR about that change, rather than about just adding tests.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
I've created Yay295#13 with some suggestions. |
Thanks! |
Added some tests for Image methods that deal with bytes, and a test that
helper.hopper()
works for all image modes.One of the tests failed though: https://github.com/Yay295/Pillow/actions/runs/5237154342/jobs/9455150887
FAILED Tests/test_image.py::TestImageBytes::test_pixels_after_getdata_putdata[I;16N-1-2] - assert (1, 1029, 515, 1543) == (256, 1284, 770, 1798)
For some reason doing
image.putdata(image.getdata())
on anI;16N
image on a big-endian machine (s390x) changes the pixels.