-
-
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
Some unpackers are misnamed #8021
Comments
This is related to #8019, because I wrote those packers in the correct order, which is actually the opposite of the unpackers. |
Here's the names they should be based on what they actually do and the format specified in Pillow/src/libImaging/Unpack.c Lines 1534 to 1543 in 824db71
RGB;15 → XBGR;1555 Unfortunately the specified format doesn't quite work because the bands in these modes aren't all the same size, so I just listed all of the sizes for those modes. The good thing about listing out the band sizes though is that those names aren't already being used, so I could add all of them as "new" rawmodes and the old ones could be deprecated without interfering with one another. |
There's a slightly awkward overlap in code that would change with this and with #7965. |
I have a branch for these changes, but it's based on #8026 because it affects the same test file. |
That branch has now become #8158 |
RGB15 actually reads data as XBGR (XBBBBBGGGGGRRRRR).
Pillow/src/libImaging/Unpack.c
Lines 661 to 674 in a8f434f
RGBA15 actually reads data as ABGR (ABBBBBGGGGGRRRRR).
Pillow/src/libImaging/Unpack.c
Lines 676 to 689 in a8f434f
RGBA4B actually reads data as ABGR (AAAABBBBGGGGRRRR).
Pillow/src/libImaging/Unpack.c
Lines 766 to 779 in a8f434f
etc.
Basically, all of the unpackers that read less than 8 bits per band appear to be backwards.
The text was updated successfully, but these errors were encountered: