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

Image displayed without color (Red changed to Black) #6931

Closed
WalterYongtaoWang opened this issue Jan 27, 2016 · 12 comments · Fixed by #12219
Closed

Image displayed without color (Red changed to Black) #6931

WalterYongtaoWang opened this issue Jan 27, 2016 · 12 comments · Fixed by #12219
Labels

Comments

@WalterYongtaoWang
Copy link

test.pdf

Open the attachment. The logo and company name on top right is in black, but it should be in red.

@THausherr
Copy link
Contributor

File is correctly displayed with gs and a commercial java product whose name starts with j. File is incorrectly displayed with PDFBox and a commercial java product whose name starts with i. PDFBox complains about a bad icc profile and uses the RGB colorspace instead.

@WalterYongtaoWang
Copy link
Author

Chrome display this in blue (should be red). I also reported a bug to them:
https://code.google.com/p/chromium/issues/detail?id=581742

Acrobat Reader and SumatraPDF (MuPDF) can display this correctly in my test.

@Snuffleupagus
Copy link
Collaborator

I've briefly looked at this PDF file, using http://brendandahl.github.io/pdf.js.utils/browser/.
I'm not sure if it's relevant to the issue at hand, but I noticed that just prior to painting the image (with /R80 Do), the Graphics State is set (through /R79 gs).
That particular GState includes a transfer function entry (TR), comprised of an array with four functions. Hence I'm wondering if we would need to parse those transfer functions, and then apply them when painting the image (in canvas.js, similar to how transfer functions are handled for SMasks).

@yurydelendik
Copy link
Contributor

@Snuffleupagus we can always replace functions by LUT if we cannot perform color transforms on the the core side. See also #6723 and #5046 (comment) .

@yurydelendik
Copy link
Contributor

Mac OSX Preview displays the same way as us (see screenshots of PDF.js, Chrome, Preview, Adobe Reader):

screen shot 2016-01-29 at 10 13 21 am

@Snuffleupagus
Copy link
Collaborator

@WalterYongtaoWang Are you the author of the PDF file, and if so may we include it in our test-suite?

@THausherr
Copy link
Contributor

Here's a document that has both: page 4 has an array of transfer functions, page 11 and 12 have a single transfer function for all colorants. This is a NASA document (I googled "Planetary Systems Branch") , thus not copyrighted.
https://issues.apache.org/jira/secure/attachment/12785801/PDFBOX-3221-023321.pdf

Another non copyrighted PDF with a single transfer function:
http://nvlpubs.nist.gov/nistpubs/sp958-lide/132-134.pdf

@WalterYongtaoWang
Copy link
Author

@Snuffleupagus I'm really sorry, this is from our customer and they don't want to include this PDF file into the test suites.

@timvandermeij
Copy link
Contributor

@WalterYongtaoWang Is there any way you could generate a minimal test case, i.e., a PDF file with only the logo in it and no other data? If that's also not possible, we might need to look into creating a reduced test case from this PDF, which will be hard I'm afraid :(

@WalterYongtaoWang
Copy link
Author

pdfbug.pdf

I made some changes. Please included this one in your test suites. Thanks.

@timvandermeij
Copy link
Contributor

@WalterYongtaoWang Awesome, thank you for providing this file!

@Snuffleupagus
Copy link
Collaborator

https://bugzilla.mozilla.org/show_bug.cgi?id=1149713 contains another example of a PDF file where some images utilise transfer functions.

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

Successfully merging a pull request may close this issue.

5 participants