Bug 39012

Summary: patch to make -level1sep write gray instead of cmyk
Product: poppler Reporter: William Bader <williambader>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: williambader
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: patch to make -level1sep write gray instead of cmyk

Description William Bader 2011-07-06 12:27:41 UTC
Created attachment 48834 [details] [review]
patch to make -level1sep write gray instead of cmyk

This patch makes pdftops -level1sep write gray instead of cmyk for gray images,
similar to the previous patches for-level2sep and -level3sep in Bug 37688 https://bugs.freedesktop.org/show_bug.cgi?id=37688
When pdftops -level1sep needs to write a bitmap, and the image is grayscale,
this patch makes the resulting ps file 1/4 of the size.
Comment 1 Albert Astals Cid 2011-07-06 13:07:47 UTC
Why 

@@ -506,7 +506,6 @@
   "         /pdfTextClipPath [] def } def",
   "~1ns",
   "% Level 1 image operators",
-  "~1n",
   "/pdfIm1 {",
   "  /pdfImBuf1 4 index string def",
   "  { currentfile pdfImBuf1 readhexstring pop } image",

?
Comment 2 William Bader 2011-07-06 14:09:14 UTC
>Why

Thanks for looking at the patches so quickly.

pdfIm1 and pdfIm1Bin used to be for level1 only.
With the patches, level1sep can now use it when it finds a gray bitmap, so pdfIm1 and pdfIm1Bin are needed for both level1 and level1sep.
Since the preceding line is already for ~1ns, I removed the ~1n instead of changing it to a redundant ~1ns.

William
Comment 3 Albert Astals Cid 2011-07-25 15:11:10 UTC
Patch is in

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.