Bug 31632

Summary: cairo 1.10.0 generates wrong PostScript for gray scale JPEG image.
Product: cairo Reporter: Koji Otani <sho>
Component: postscript backendAssignee: Adrian Johnson <ajohnson>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.10.0   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: a PDF file cause this problem
a patch fix this problem

Description Koji Otani 2010-11-15 03:31:23 UTC
Created attachment 40280 [details]
a PDF file cause this problem

On Fedora 14 Linux, I can't print a PDF includes Gray scale JPEG Image with evince. Evince uses libcairo to generate PostScript for printing. And I've found a generated PostScript was wrong.
It includes following code.

/DeviceGray setcolorspace
8 dict dup begin
  /ImageType 1 def
  /Width 180 def
  /Height 139 def
  /BitsPerComponent 8 def
  /Decode [ 0 1 0 1 0 1 ] def
  /DataSource currentfile /ASCII85Decode filter /DCTDecode filter def
  /ImageMatrix [ 1 0 0 -1 0 139 ] def
end

Number of elements in Decode array is wrong when colorspace is /DeviceGray.

I attached a sample PDF and a patch to fix this problem.
Comment 1 Koji Otani 2010-11-15 03:32:48 UTC
Created attachment 40281 [details] [review]
a patch fix this problem
Comment 2 Adrian Johnson 2010-11-16 05:46:21 UTC
Committed to master:
http://cgit.freedesktop.org/cairo/commit/?id=653ceb517fe756b042a3cf8322a36cbfe71ddbd8

Thanks for the patch.

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.