Bug 22026 - patch to fix ps generation from pdftops with -level1sep
Summary: patch to fix ps generation from pdftops with -level1sep
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: splash backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-01 14:40 UTC by William Bader
Modified: 2009-06-03 13:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
suggested patch to poppler-0.10.7/poppler/SplashOutputDev.cc (1.05 KB, patch)
2009-06-01 14:42 UTC, William Bader
Details | Splinter Review
example of bad output from -level1sep (239.69 KB, image/gif)
2009-06-03 13:21 UTC, William Bader
Details
rendering with -level1sep fixed but without the luminosity color[4] fix (140.79 KB, image/gif)
2009-06-03 13:22 UTC, William Bader
Details

Description William Bader 2009-06-01 14:40:47 UTC
-level1sep requires building with -DSPLASH_CMYK.  If you do the build, SplashOutputDev::setSoftMask in SplashOutputDev.cc calculates luminance in the case for splashModeCMYK8 using color[4] instead of color[3] for the black component. The attached file shows this problem.
Comment 1 William Bader 2009-06-01 14:42:14 UTC
Created attachment 26344 [details] [review]
suggested patch to poppler-0.10.7/poppler/SplashOutputDev.cc
Comment 2 William Bader 2009-06-01 14:48:23 UTC
My sample file is 3 MB and too large to post.  Contact me at williambader@hotmail.com for a copy by email.
Comment 3 Albert Astals Cid 2009-06-03 12:27:55 UTC
the color[4] -> color[3] thing is already fixed in master.

For the other issue i think i like better this

diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index d24e77e..323d08e 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -2951,6 +2951,10 @@ GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/,
     paperColor[0] = paperColor[1] = paperColor[2] = paperColor[3] = 0;
     splashOut = new SplashOutputDev(splashModeCMYK8, 1, gFalse,
                                    paperColor, gTrue, gFalse);
+#else
+  } else if (level == psLevel1Sep) {
+    error(-1, "pdftops was built without CMYK support, -level1sep needs it to work in this file");
+    return gFalse;
 #endif
   } else {
     paperColor[0] = paperColor[1] = paperColor[2] = 0xff;

What do you think?
Comment 4 William Bader 2009-06-03 13:21:49 UTC
Created attachment 26405 [details]
example of bad output from -level1sep
Comment 5 William Bader 2009-06-03 13:22:49 UTC
Created attachment 26406 [details]
rendering with -level1sep  fixed but without the luminosity color[4] fix
Comment 6 William Bader 2009-06-03 13:30:27 UTC
Yes, your patch is better than mine because it reports an error only when PSOutputDev::checkPageSlice() is called and poppler has been compiled without SPLASH_CMYK.  pdftops will process many files correctly, even without SPLASH_CMYK, as long as it does not call checkPageSlice().
I have attached a rendering with and without SPLASH_CMYK to show what happens in case anyone else runs into this.
Comment 7 Albert Astals Cid 2009-06-03 13:38:43 UTC
Patch commited, will be in next poppler version


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.