summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2018-11-07 15:42:43 +0000
committerRobin Watts <robin.watts@artifex.com>2018-11-07 15:44:56 +0000
commit86330c6fd626a861daba86994dff8596d939fddd (patch)
treead1c1eadcd3a6f6c2a49a453370bb64a03164de2 /source
parent80540880944bb9c1cdf4d2e955d3f1378dfbacb8 (diff)
downloadmupdf-86330c6fd626a861daba86994dff8596d939fddd.tar.xz
Fix double header output in muraster.
Also fiddle the #ifdeffery to get sane defaults.
Diffstat (limited to 'source')
-rw-r--r--source/tools/muraster.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/source/tools/muraster.c b/source/tools/muraster.c
index 472e0036..92a9d061 100644
--- a/source/tools/muraster.c
+++ b/source/tools/muraster.c
@@ -157,6 +157,21 @@ int gettimeofday(struct timeval *tv, struct timezone *tz);
these for configuration.
*/
+/* Unless we have specifically disabled threading, enable it. */
+#ifndef DISABLE_MUTHREADS
+#ifndef MURASTER_THREADS
+#define MURASTER_THREADS 1
+#endif
+#endif
+
+/* If we have threading, and we haven't already configured BGPRINT,
+ * enable it. */
+#if MURASTER_THREADS != 0
+#ifndef MURASTER_CONFIG_BGPRINT
+#define MURASTER_CONFIG_BGPRINT 1
+#endif
+#endif
+
#ifdef MURASTER_CONFIG_X_RESOLUTION
#define X_RESOLUTION MURASTER_CONFIG_X_RESOLUTION
#else
@@ -612,7 +627,6 @@ static int dodrawpage(fz_context *ctx, int pagenum, fz_cookie *cookie, render_de
pix = fz_new_pixmap_with_bbox(ctx, colorspace, ibounds, NULL, 0);
fz_set_pixmap_resolution(ctx, pix, x_resolution, y_resolution);
}
- fz_write_header(ctx, render->bander, pix->w, total_height, pix->n, pix->alpha, pix->xres, pix->yres, pagenum, pix->colorspace, pix->seps);
for (band = 0; band < bands; band++)
{
@@ -715,7 +729,7 @@ static int try_render_page(fz_context *ctx, int pagenum, fz_cookie *cookie, int
{
int w = render->ibounds.x1 - render->ibounds.x0;
int h = render->ibounds.y1 - render->ibounds.y0;
- fz_write_header(ctx, render->bander, w, h, 0, render->n, 0, 0, 0, 0, NULL);
+ fz_write_header(ctx, render->bander, w, h, render->n, 0, 0, 0, 0, 0, NULL);
}
fz_catch(ctx)
{