From d54763bcd644364c19d3a6a12f889127df583e01 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 12 Jul 2017 21:18:45 +0100 Subject: Update band writer (especially PSD) to cope with spots PSD writer now outputs spot colors. Ensure subtractive colorspaces are stored with proper polarity. The CMYK and spot components need to be 255-X in the PSD format Store PSD format resources using correct Pascal style strings. Photoshop will fail to open if the the ICC profile resource name is not in proper format. (Incorporates fixes from Michael). --- source/fitz/output-ps.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/fitz/output-ps.c') diff --git a/source/fitz/output-ps.c b/source/fitz/output-ps.c index 126c54ff..3c8c3146 100644 --- a/source/fitz/output-ps.c +++ b/source/fitz/output-ps.c @@ -59,6 +59,9 @@ ps_write_header(fz_context *ctx, fz_band_writer *writer_, const fz_colorspace *c float sy = (float) h / h_points; int err; + if (writer->super.s != 0) + fz_throw(ctx, FZ_ERROR_GENERIC, "Postscript writer cannot cope with spot colors"); + if (alpha != 0) fz_throw(ctx, FZ_ERROR_GENERIC, "Postscript output cannot have alpha"); @@ -156,7 +159,7 @@ void fz_write_pixmap_as_ps(fz_context *ctx, fz_output *out, const fz_pixmap *pix 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) -- cgit v1.2.3