Bug 31632 - cairo 1.10.0 generates wrong PostScript for gray scale JPEG image.
Summary: cairo 1.10.0 generates wrong PostScript for gray scale JPEG image.
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: postscript backend (show other bugs)
Version: 1.10.0
Hardware: All Linux (All)
: medium normal
Assignee: Adrian Johnson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-15 03:31 UTC by Koji Otani
Modified: 2010-11-16 05:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
a PDF file cause this problem (10.62 KB, application/pdf)
2010-11-15 03:31 UTC, Koji Otani
Details
a patch fix this problem (648 bytes, patch)
2010-11-15 03:32 UTC, Koji Otani
Details | Splinter Review

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.