Tests for byte methods
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 an I;16N image on a big-endian maching (s390x) changes the pixels.
Looks like the problem is here:
https://github.com/python-pillow/Pillow/blob/706f8f6465cc1194d4a06b0a3cd6383023b822e8/src/_imaging.c#L1574-L1590
The code is handling for endianness for "I;16B", but not "I;16N" on a big-endian machine.
a test that
helper.hopper()works for all image modes
Why would we need to test that this runs without error for all image modes? hopper() isn't part of Pillow, just the test suite. I don't see a need to start testing the tests.
Yay295 force-pushed the
bytes_testsbranch
GitHub's suggestion auto-commit added an extra brace for some reason.
Why would we need to test that this runs without error for all image modes?
hopper()isn't part of Pillow, just the test suite. I don't see a need to start testing the tests.
You're right. This will essentially be tested just by using it in other tests anyways.
rebased on main
Can this be merged?
I've created https://github.com/Yay295/Pillow/pull/13 with some suggestions.
Thanks!