diff options
Diffstat (limited to 'source/fitz/output-png.c')
-rw-r--r-- | source/fitz/output-png.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/fitz/output-png.c b/source/fitz/output-png.c index e86c82c9..b86ea648 100644 --- a/source/fitz/output-png.c +++ b/source/fitz/output-png.c @@ -33,7 +33,7 @@ fz_save_pixmap_as_png(fz_context *ctx, fz_pixmap *pixmap, const char *filename) fz_try(ctx) { writer = fz_new_png_band_writer(ctx, out); - fz_write_header(ctx, writer, pixmap->w, pixmap->h, pixmap->n, pixmap->alpha, pixmap->xres, pixmap->yres, 0, pixmap->colorspace); + fz_write_header(ctx, writer, pixmap->w, pixmap->h, pixmap->n, pixmap->alpha, pixmap->xres, pixmap->yres, 0, pixmap->colorspace, pixmap->seps); fz_write_band(ctx, writer, pixmap->stride, pixmap->h, pixmap->samples); } fz_always(ctx) @@ -59,7 +59,7 @@ fz_write_pixmap_as_png(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap) fz_try(ctx) { - fz_write_header(ctx, writer, pixmap->w, pixmap->h, pixmap->n, pixmap->alpha, pixmap->xres, pixmap->yres, 0, pixmap->colorspace); + fz_write_header(ctx, writer, pixmap->w, pixmap->h, pixmap->n, pixmap->alpha, pixmap->xres, pixmap->yres, 0, pixmap->colorspace, pixmap->seps); fz_write_band(ctx, writer, pixmap->stride, pixmap->h, pixmap->samples); } fz_always(ctx) @@ -147,6 +147,9 @@ png_write_header(fz_context *ctx, fz_band_writer *writer_, const fz_colorspace * unsigned char head[13]; int color; + if (writer->super.s != 0) + fz_throw(ctx, FZ_ERROR_GENERIC, "PNGs cannot contain spot colors"); + /* Treat alpha only as greyscale */ if (n == 1 && alpha) alpha = 0; |