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.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/fitz/output.c') diff --git a/source/fitz/output.c b/source/fitz/output.c index 3240be12..08ee50fe 100644 --- a/source/fitz/output.c +++ b/source/fitz/output.c @@ -392,18 +392,21 @@ fz_band_writer *fz_new_band_writer_of_size(fz_context *ctx, size_t size, fz_outp return writer; } -void fz_write_header(fz_context *ctx, fz_band_writer *writer, int w, int h, int n, int alpha, int xres, int yres, int pagenum, const fz_colorspace *cs) +void fz_write_header(fz_context *ctx, fz_band_writer *writer, int w, int h, int n, int alpha, int xres, int yres, int pagenum, const fz_colorspace *cs, fz_separations *seps) { if (writer == NULL || writer->band == NULL) return; + writer->w = w; writer->h = h; + writer->s = fz_count_active_separations(ctx, seps); writer->n = n; writer->alpha = alpha; writer->xres = xres; writer->yres = yres; writer->pagenum = pagenum; writer->line = 0; + writer->seps = fz_keep_separations(ctx, seps); writer->header(ctx, writer, cs); } @@ -433,5 +436,6 @@ void fz_drop_band_writer(fz_context *ctx, fz_band_writer *writer) return; if (writer->drop != NULL) writer->drop(ctx, writer); + fz_drop_separations(ctx, writer->seps); fz_free(ctx, writer); } -- cgit v1.2.3