Bug 28873

Summary: displays PNG image embedded in PDF with wrong colors
Product: poppler Reporter: Pedro Villavicencio <pvillavi>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Example pdf file
Correct rendering
Incorrect rendering

Description Pedro Villavicencio 2010-07-01 13:31:36 UTC
this report has been filed here:

https://bugs.edge.launchpad.net/ubuntu/+source/poppler/+bug/600558

"Flesh tones are purple, blondes are green, etc. See linked pdf"

pdf:

http://launchpadlibrarian.net/51228635/Fall70.pdf

It works fine with xpdf and acroread.thanks!.
Comment 1 Carlos Garcia Campos 2010-07-02 01:41:02 UTC
There must be something wrong in DCTStream.cc since building with --disable-libjpeg fixes the issue.
Comment 2 Brad Hards 2010-07-02 02:55:06 UTC
Image is perhaps in CMYK, but its being treated as RGB?
Comment 3 Carlos Garcia Campos 2010-07-02 03:15:29 UTC
It's RGB:

<< /BitsPerComponent 8 /ColorSpace /DeviceRGB /DecodeParms << /ColorTransform 0 >> /Filter /DCTDecode /Height 331 /Subtype /Image /Type /XObject /Width 295 /Length 88452 >>
Comment 4 James Cloos 2010-07-02 09:25:10 UTC
> There must be something wrong in DCTStream.cc since building with
> --disable-libjpeg fixes the issue.

That also would explain why it fails for both splash and cairo backends.
Comment 5 Albert Astals Cid 2010-07-12 15:38:24 UTC
We are not handling colorXform in DCTStream.cc anyone up for copying the code from Stream.cc ?
Comment 6 Carlos Garcia Campos 2010-07-13 01:32:10 UTC
Fixed in master and poppler-0.14. Thanks!
Comment 7 matous.ringel 2011-02-11 05:15:48 UTC
Created attachment 43246 [details]
Example pdf file
Comment 8 matous.ringel 2011-02-11 05:16:23 UTC
Created attachment 43247 [details]
Correct rendering
Comment 9 matous.ringel 2011-02-11 05:16:45 UTC
Created attachment 43248 [details]
Incorrect rendering
Comment 10 matous.ringel 2011-02-11 05:22:39 UTC
I don't think this is fixed. I attach an example PDF file, which has broken colors in poppler >= 0.14.2, but renders correctly in poppler <= 0.14.1. 

The pdf was created by imagemagick (convert), which apparently uses Ghostscript. 

Interestingly, the utility pdfimages with option -j renders the page correctly (see attachment), while pdftoppm and the library itself renders it incorrectly (see attachment). 

I also tried compiling libpoppler with openjpeg. It didn't help. In Acroread 9 it is broken as well.
Comment 11 Albert Astals Cid 2011-02-11 11:22:26 UTC
What you call "Incorrect Rendering" is the correct rendering.
Comment 12 matous.ringel 2011-02-11 14:06:33 UTC
(In reply to comment #11)
> What you call "Incorrect Rendering" is the correct rendering.

Albert, thank you for your reply and time. Could you please develop your point in more detail? 

I mean: rendering by pdfimages -j is "correct" in the sense that it corresponds to the original I scanned. Rendering by pdftoppm is different, I called it "incorrect", since it is not the desired result.

How comes that the renderings are different? Is my PDF file broken in some way? But if so, why is it rendered correctly by poppler versions <=0.14.1 and even by pdfimages in versions >= 0.14.2?
Comment 13 Albert Astals Cid 2011-02-11 14:15:13 UTC
pdfimages -j extract the images from inside the file, does not render the pdf. pdftoppm renders the pdf file. The pdf file specifies a different rendering colorspace or something that makes it render weird. That means the tool that you used to create the pdf is broken. Complain to them.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.