-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
JPEG2000: Support decoding subsampled RGB and YCbCr images #4996
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
Conversation
|
python-pillow/pillow-depends#35 merged, CI restarted. |
|
@nulano I am getting the following compiler warnings with clang (version 12) on Mac OSX: When I try to compile it with clang (version 11) on Linux (Ubuntu 20.04), compilation fails: |
|
@hackermd Thank you for testing. All of those warnings are unrelated to this PR and should now be fixed by the merge @radarhere did just above your comment. You didn't provide a log for the Linux Docker build, but I'm guessing it uses |
|
@nulano the build is already based on 2341c6b Here is the relevant part of the docker build log: |
|
I don't see an error in that output, I think there might still be something missing. I also don't see why this PR should cause any compile issues, have you tried compiling the master branch? |
I am getting the same issue when trying to compile the master branch. Do I need to configure anything else for using clang to compile PIL on Ubuntu? I am fine with using GCC. |
|
Is there anything blocking this? |
|
I don't think so. There are a few uncovered lines, but we'd need to find specific j2k files to hit them. |
|
This does interact with an upcoming security patch. It's a pretty trivial merge fix, but it changes the error from the test cases. |
|
I think I'd prefer to merge this just after the release, so that we don't potentially trip up a security issue. |
|
I was ok with this before the release, except for the potential conflict with the security patch. Lets get it merged and fix things up if necessary. |
Fixes #4991
Fixes #3946
Adds support decoding subsampled RGB and YCbCr JPEG2000 images.
I left the grayscale formats as-is as I was a bit confused by the code and did not find test files for these formats.
Test images are from https://github.com/uclouvain/openjpeg-data, but these are huge and have an unusual license, so they are in python-pillow/pillow-depends#35.
subsampling_1.jp2andzoo1.jp2are YCbCr 4:2:0 andsubsampling_2.jp2andzoo2.jp2are something like RGB 2:2:0 (2x2 subsampling for all 3 channels). This list is based on this OpenJPEG test.Until the pillow-depends PR is merged, see successful test in another branch: https://github.com/nulano/Pillow/runs/1279251514?check_suite_focus=true#step:10:425All four images have
color_space = OPJ_CLRSPC_UNSPECIFIED, and based on uclouvain/openjpeg#570 I think this may be a bug, but I did not look into fixing this.