Bug 59179

Summary: Some colors appear grey/black, whereas it works with Adobe Reader
Product: poppler Reporter: Germán Poo-Caamaño <gpoo+bfdo>
Component: cairo backendAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
See Also: https://bugzilla.gnome.org/show_bug.cgi?id=691430
https://bugs.freedesktop.org/show_bug.cgi?id=65780
Whiteboard:
i915 platform: i915 features:
Attachments: PDF test for color mismatch
Screenshot of Acroread and Evince output
support uncolored tiling patterns
support uncolored tiling patterns

Description Germán Poo-Caamaño 2013-01-09 19:37:53 UTC
Created attachment 72749 [details]
PDF test for color mismatch

As it was reported in GNOME Bugzilla:

--------------------------------------------------------------
On one specific document that I have, some colors are not displayed correcly.
With Adode Reader, I have different colors. With Evince, everything is gray.

Here is the link to the document:
http://www.info.ucl.ac.be/~pecheur/talks/VVof2GRLV-FAABS02.pdf

Slide 13 has this issue: yellow, red and green are all gray. I've attached a a
picture showing how this slide is displayed by both pdf viewers.
--------------------------------------------------------------

I took out only the page 13 that shows the issue.  You will find it attached.
I can reproduce the problem with pdftocairo -png.
Comment 1 Germán Poo-Caamaño 2013-01-09 19:39:00 UTC
Created attachment 72750 [details]
Screenshot of Acroread and Evince output
Comment 2 Germán Poo-Caamaño 2013-01-09 19:41:06 UTC
I forgot to add:

I tested it against cairo 1.12 and poppler master (bef2c42f381c74fd,
the commit after 0.22.0).
Comment 3 Albert Astals Cid 2013-01-09 19:43:24 UTC
FWIW it works fine in splash
Comment 4 Adrian Johnson 2013-01-24 11:53:18 UTC
Created attachment 73562 [details] [review]
support uncolored tiling patterns

The cairo backend does not support uncolored tiling patterns. This caused uncolored patterns to be drawn in gray.

The attached patch fixes this.
Comment 5 Carlos Garcia Campos 2013-01-24 14:10:01 UTC
(In reply to comment #4)
> Created attachment 73562 [details] [review] [review]
> support uncolored tiling patterns
> 
> The cairo backend does not support uncolored tiling patterns. This caused
> uncolored patterns to be drawn in gray.
> 
> The attached patch fixes this.

This looks sane to me, but I'm getting a small regression in one of my files, I'll send the pdf file to you by email. Thanks
Comment 6 Adrian Johnson 2013-01-25 12:01:03 UTC
Created attachment 73644 [details] [review]
support uncolored tiling patterns

It turns out that we can't use cairo_mask for uncolored patterns since cairo_mask uses the alpha and not the luminosity to mask the source.

This patch uses the same solution as uncolored patterns in PSOutputDev. It adds a flag to indicate we are rendering an uncolored pattern and disables setting the color when the flag is true.
Comment 7 Carlos Garcia Campos 2013-01-28 14:57:15 UTC
(In reply to comment #6)
> Created attachment 73644 [details] [review] [review]
> support uncolored tiling patterns
> 
> It turns out that we can't use cairo_mask for uncolored patterns since
> cairo_mask uses the alpha and not the luminosity to mask the source.
> 
> This patch uses the same solution as uncolored patterns in PSOutputDev. It
> adds a flag to indicate we are rendering an uncolored pattern and disables
> setting the color when the flag is true.

Great, no regressions this time. Thanks! Please, don't use braces for single statement ifs. Feel free to push.
Comment 8 Adrian Johnson 2013-01-28 20:59:10 UTC
I've removed the surplus braces and pushed.

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.