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

Colors in JPGs with CMYK are not parsed correctly #9513

Closed
photopea opened this issue Feb 27, 2018 · 2 comments
Closed

Colors in JPGs with CMYK are not parsed correctly #9513

photopea opened this issue Feb 27, 2018 · 2 comments

Comments

@photopea
Copy link

photopea commented Feb 27, 2018

Hi, I have several CMYK files, where I get incorrect colors after decoding them with pdf.js

I discovered, that it could be fixed by inverting the input. At line 1051 (and four following lines) https://github.com/mozilla/pdf.js/blob/master/src/core/jpg.js#L1051 we should have Y = 255-data[i] and vice versa.

I would like to find the original author and ask him about this part of the code. I could not find any CMYK JPG, for which the current code would work. I only found 3 JPGs, for which my "inverted" code works.

jpg11 1
channel_digital_image_cmyk_color
insta

@photopea
Copy link
Author

photopea commented Sep 1, 2018

Guys, I created a pull request. It solves the problem and does not break anything (but only for my set of testing JPGs). #10029

@timvandermeij
Copy link
Contributor

Fixed by #10031.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants