[Poppler-bugs] [Bug 31926] New: pdftops-0.15.2 -level1sep inverts the image mask polarity
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Thu Nov 25 19:27:32 PST 2010
https://bugs.freedesktop.org/show_bug.cgi?id=31926
Summary: pdftops-0.15.2 -level1sep inverts the image mask
polarity
Product: poppler
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: medium
Component: general
AssignedTo: poppler-bugs at lists.freedesktop.org
ReportedBy: williambader at hotmail.com
CC: williambader at hotmail.com
Created an attachment (id=40578)
--> (https://bugs.freedesktop.org/attachment.cgi?id=40578)
pdf that shows the problem
The non-dictionary form of the imagemask operator has a parameter called
"polarity". According to the postscript language reference manual,
Decode [1 0] -> polarity true = paint 1 bits, ignore 0 bits, and
Decode [0 1] -> polarity false = ignore 1 bits, paint 0 bits.
PSOutputDev.cc calls the "polarity" parameter "invert".
With level 2 output, it doesn't matter as long as the mapping back and forth
between the Decode dictionary entry and the poppler "invert" variable is
consistent.
With level 1 output, PSOutputDev.cc writes the "invert" variable as the
"polarity" argument to imagemask (wrapped by pdfImM1), and as a result, the
polarity of imagemasks is flipped with -level1sep.
The patch below fixes the problem.
--- poppler-0.15.2/poppler/PSOutputDev.cc- 2010-11-10 23:31:51.000000000
+0100
+++ poppler-0.15.2/poppler/PSOutputDev.cc 2010-11-26 03:52:13.871729108
+0100
@@ -4544,7 +4562,7 @@
// image/imagemask command
if ((inType3Char || preload) && !colorMap) {
writePSFmt("{0:d} {1:d} {2:s} [{3:d} 0 0 {4:d} 0 {5:d}] pdfImM1a\n",
- width, height, invert ? "true" : "false",
+ width, height, invert ? "false" : "true",
width, -height, height);
} else if (colorMap) {
writePSFmt("{0:d} {1:d} 8 [{2:d} 0 0 {3:d} 0 {4:d}] pdfIm1\n",
@@ -4552,7 +4570,7 @@
width, -height, height);
} else {
writePSFmt("{0:d} {1:d} {2:s} [{3:d} 0 0 {4:d} 0 {5:d}] pdfImM1\n",
- width, height, invert ? "true" : "false",
+ width, height, invert ? "false" : "true",
width, -height, height);
}
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Poppler-bugs
mailing list