From 5127d6fe0fb46f4baf0b67dc8c966cc8cc676475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Fri, 16 Aug 2013 23:28:28 +0200 Subject: invert color transformed CMYK JPEG images This fixes among others 693274 - cmyk jpeg image.xps from bug 693274. --- source/fitz/image.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/fitz') diff --git a/source/fitz/image.c b/source/fitz/image.c index 0aeb449d..899232e0 100644 --- a/source/fitz/image.c +++ b/source/fitz/image.c @@ -299,6 +299,16 @@ fz_image_get_pixmap(fz_context *ctx, fz_image *image, int w, int h) indexed = fz_colorspace_is_indexed(image->colorspace); tile = fz_decomp_image_from_stream(ctx, stm, image, 0, indexed, l2factor, native_l2factor); + + /* CMYK JPEGs in XPS documents have to be inverted */ + if (image->invert_cmyk_jpeg && + image->buffer->params.type == FZ_IMAGE_JPEG && + image->colorspace == fz_device_cmyk(ctx) && + image->buffer->params.u.jpeg.color_transform) + { + fz_invert_pixmap(ctx, tile); + } + break; } -- cgit v1.2.3