summaryrefslogtreecommitdiff
path: root/source/fitz/load-tiff.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-12-21 16:19:28 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-12-27 15:06:51 +0100
commit9423400441f32a4c28651ee255cb95cecf49a57a (patch)
tree1cea74f63248ca990e92ca73ef52a87d04aed769 /source/fitz/load-tiff.c
parentbc0b5d4b39e3050c36162d719666053e520161c9 (diff)
downloadmupdf-9423400441f32a4c28651ee255cb95cecf49a57a.tar.xz
Common code to ensure we only premultiply pixmaps with additive colors.
Diffstat (limited to 'source/fitz/load-tiff.c')
-rw-r--r--source/fitz/load-tiff.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/source/fitz/load-tiff.c b/source/fitz/load-tiff.c
index 7262b23e..8d759254 100644
--- a/source/fitz/load-tiff.c
+++ b/source/fitz/load-tiff.c
@@ -1283,14 +1283,7 @@ fz_load_tiff_subimage(fz_context *ctx, unsigned char *buf, size_t len, int subim
/* We should only do this on non-pre-multiplied images, but files in the wild are bad */
if (tiff.extrasamples /* == 2 */)
{
- /* CMYK is a subtractive colorspace, we want additive for premul alpha */
- if (image->n == 5)
- {
- fz_pixmap *rgb = fz_convert_pixmap(ctx, image, fz_device_rgb(ctx), 1);
- fz_drop_pixmap(ctx, image);
- image = rgb;
- }
-
+ image = fz_ensure_pixmap_is_additive(ctx, image);
fz_premultiply_pixmap(ctx, image);
}
}