diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-07-16 11:41:16 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-07-18 12:51:49 +0100 |
commit | cb62fbac8d7f4445aad87aa186ce80d5766ef22f (patch) | |
tree | d216b7908084e2b251ea9b20f6437c12e2112212 | |
parent | 6baaf58eacce0a2edaa520e1f08af9e120090c17 (diff) | |
download | mupdf-cb62fbac8d7f4445aad87aa186ce80d5766ef22f.tar.xz |
Attempt to fix PWG output.
Broken by alpha changes.
-rw-r--r-- | source/fitz/output-pwg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/fitz/output-pwg.c b/source/fitz/output-pwg.c index 50e25a13..b3e51c9f 100644 --- a/source/fitz/output-pwg.c +++ b/source/fitz/output-pwg.c @@ -96,13 +96,13 @@ fz_write_pixmap_as_pwg_page(fz_context *ctx, fz_output *out, const fz_pixmap *pi if (!out || !pixmap) return; - if (pixmap->n != 1 && pixmap->n != 2 && pixmap->n != 4 && pixmap->n != 5) + if (pixmap->alpha != 0) + fz_throw(ctx, FZ_ERROR_GENERIC, "cannot write pwg with alpha"); + sn = pixmap->n; + if (sn != 1 && sn != 3 && sn != 4) fz_throw(ctx, FZ_ERROR_GENERIC, "pixmap must be grayscale, rgb or cmyk to write as pwg"); - sn = pixmap->n; dn = pixmap->n; - if (dn > 1) - dn--; fz_write_pwg_page_header(ctx, out, pwg, pixmap->xres, pixmap->yres, pixmap->w, pixmap->h, dn*8); |