-
Notifications
You must be signed in to change notification settings - Fork 455
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
No colorspace information after opj_read_header #570
Comments
Indeed, this is necessary. I have cases where I need the color space information before decoding the image. |
I recently discovered the same. Only after calling Would you accept patches to try to move the colorspace detection code to some function called by |
@ OpenJPEG developers: any comments on this issue? |
attempt fix in #1463 . I'd appreciate if reporters could test that it actually fixes the issue (I'm not sure openjpeg test suite tests that) |
@rouault Unfortunately no, as I'm not using openjpeg directly, but only through pdfium, which bundles openjpeg. Apart from that, could you add a test case to confirm your implementation works? |
@rouault I did a little investigation. I think changed so that one can access normal colorspaces after calling As I understand it file1.jp2 from your testsuite sets sRGB in its COLR box. And now after your commit I see that As for ICC profiles relax.jp2 appears to set an ICC profile in its COLR box and after the call to |
…p2_decode()/get_tile() + add unit test (fixes uclouvain#570)
pull request amended to move ICC profile setting to image in read_header() |
opj_jp2_read_header(): move setting color_space here instead in opj_jp2_decode()/get_tile() (fixes #570)
@rouault Thank you for fixing this! :) |
image->color_space and image->icc_profile* are only filled in opj_decode() and not in opj_read_header(). This is problematic in situations where the color space must be know before decoding pixel data.
This should be easily fixable by moving from opj_jp2_decode() to opj_jp2_read_header() most of the code that copies color information from the jp2 struct to the image struct.
The text was updated successfully, but these errors were encountered: