summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-04-05 17:48:24 +0100
committerRobin Watts <robin.watts@artifex.com>2012-04-05 18:01:16 +0100
commitff55e72b741b955bbd0e23bd9d724c6682a181ac (patch)
treef18deb262d2730c18d18faa0f10ba656fd530d4f /fitz
parent4184ba5d2930b337fddf3ad8e612a88adb08d8c1 (diff)
downloadmupdf-ff55e72b741b955bbd0e23bd9d724c6682a181ac.tar.xz
Bug 692946 - fix 'stray white pixels in black areas' when halftoning.
Depending on the operation used (< or <=) the threshold array should never have either 0 and ff in it. As we are using <, it should never have 0 in it. Fixed here.
Diffstat (limited to 'fitz')
-rw-r--r--fitz/res_halftone.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fitz/res_halftone.c b/fitz/res_halftone.c
index daad6e37..3b5e0e51 100644
--- a/fitz/res_halftone.c
+++ b/fitz/res_halftone.c
@@ -36,6 +36,10 @@ fz_drop_halftone(fz_context *ctx, fz_halftone *ht)
}
/* Default mono halftone, lifted from Ghostscript. */
+/* The 0x00 entry has been changed to 0x01 to avoid problems with white
+ * pixels appearing in the output; as we use < 0 should not appear in the
+ * array. I think that gs scales this slighly and hence never actually uses
+ * the raw values here. */
static unsigned char mono_ht[] =
{
0x0E, 0x8E, 0x2E, 0xAE, 0x06, 0x86, 0x26, 0xA6, 0x0C, 0x8C, 0x2C, 0xAC, 0x04, 0x84, 0x24, 0xA4,
@@ -50,7 +54,7 @@ static unsigned char mono_ht[] =
0xCD, 0x4D, 0xED, 0x6D, 0xC5, 0x45, 0xE5, 0x65, 0xCF, 0x4F, 0xEF, 0x6F, 0xC7, 0x47, 0xE7, 0x67,
0x3D, 0xBD, 0x1D, 0x9D, 0x35, 0xB5, 0x15, 0x95, 0x3F, 0xBF, 0x1F, 0x9F, 0x37, 0xB7, 0x17, 0x97,
0xFD, 0x7D, 0xDD, 0x5D, 0xF5, 0x75, 0xD5, 0x55, 0xFF, 0x7F, 0xDF, 0x5F, 0xF7, 0x77, 0xD7, 0x57,
- 0x02, 0x82, 0x22, 0xA2, 0x0A, 0x8A, 0x2A, 0xAA, 0x00, 0x80, 0x20, 0xA0, 0x08, 0x88, 0x28, 0xA8,
+ 0x02, 0x82, 0x22, 0xA2, 0x0A, 0x8A, 0x2A, 0xAA, 0x01 /*0x00*/, 0x80, 0x20, 0xA0, 0x08, 0x88, 0x28, 0xA8,
0xC2, 0x42, 0xE2, 0x62, 0xCA, 0x4A, 0xEA, 0x6A, 0xC0, 0x40, 0xE0, 0x60, 0xC8, 0x48, 0xE8, 0x68,
0x32, 0xB2, 0x12, 0x92, 0x3A, 0xBA, 0x1A, 0x9A, 0x30, 0xB0, 0x10, 0x90, 0x38, 0xB8, 0x18, 0x98,
0xF2, 0x72, 0xD2, 0x52, 0xFA, 0x7A, 0xDA, 0x5A, 0xF0, 0x70, 0xD0, 0x50, 0xF8, 0x78, 0xD8, 0x58