Skip to content
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

When reading BLP, do not trust JPEG decoder to determine image is CMYK #6767

Merged
merged 1 commit into from Dec 16, 2022

Conversation

radarhere
Copy link
Member

Resolves #6741

libjpeg 9e has decided to no longer detect the JPEG embedded within Tests/images/blp/blp1_jpeg.blp as being CMYK.

To allow our tests to still pass, if the BLP JPEG is in CMYK mode, this PR passes a value for jpegmode, so that JpegDecode.c will override what libjpeg has detected.

Testing in libjpeg 9d and 9e in my fork of pillow-wheels, the BLP tests fail without this, and pass with it.

@kulikjak
Copy link
Contributor

kulikjak commented Dec 6, 2022

I tested the patch myself with each Python we deliver pillow for and the test suite is green again. Thanks!

Out of curiosity, IIUIC, the fix is to tell libjpeg explicitly that the given image is "CMYK" as it no longer detects it itself (and Pillow does know that through other means)?

@radarhere
Copy link
Member Author

Yes, that's correct.

@hugovk hugovk merged commit 193b24f into python-pillow:main Dec 16, 2022
@radarhere radarhere deleted the blp_jpeg branch December 16, 2022 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_file_blp.py fails with libjpeg 9e since 9.3.0
3 participants