summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2017-07-12 18:43:07 -0700
committerRobin Watts <robin.watts@artifex.com>2017-07-17 19:32:06 +0100
commita3d05504307e05e9bcf71aff7e5e86f0090bbba2 (patch)
treef54ef0d87cc2cdc9559107e02e53eaf1499c1ec5 /source/fitz
parent8260c7b828c5df4895db15196be70b4bb58fbee7 (diff)
downloadmupdf-a3d05504307e05e9bcf71aff7e5e86f0090bbba2.tar.xz
Don't convert cmyka images to rgba
We should handle the cmyka images in their native form now that we are holding the data inverted. Fixes fts_17_1700.pdf Also fixes fts_43xx.xps
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/load-jpx.c7
-rw-r--r--source/fitz/load-tiff.c4
-rw-r--r--source/fitz/pixmap.c3
3 files changed, 1 insertions, 13 deletions
diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c
index 4065b386..2f9be9a3 100644
--- a/source/fitz/load-jpx.c
+++ b/source/fitz/load-jpx.c
@@ -406,10 +406,7 @@ jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size
if (state->pix->alpha && ! (HAS_PALETTE(colorspace) && !state->expand_indexed))
{
if (alphas > 0 && prealphas == 0)
- {
- state->pix = fz_ensure_pixmap_is_additive(ctx, state->pix);
fz_premultiply_pixmap(ctx, state->pix);
- }
}
}
fz_always(ctx)
@@ -877,12 +874,8 @@ jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size
if (jpx->color_space == OPJ_CLRSPC_SYCC && n == 3 && a == 0)
jpx_ycc_to_rgb(ctx, img, 1, 1);
-
if (a)
- {
- img = fz_ensure_pixmap_is_additive(ctx, img);
fz_premultiply_pixmap(ctx, img);
- }
}
fz_always(ctx)
opj_image_destroy(jpx);
diff --git a/source/fitz/load-tiff.c b/source/fitz/load-tiff.c
index 08ca17a7..881498c0 100644
--- a/source/fitz/load-tiff.c
+++ b/source/fitz/load-tiff.c
@@ -1320,11 +1320,9 @@ fz_load_tiff_subimage(fz_context *ctx, unsigned char *buf, size_t len, int subim
fz_unpack_tile(ctx, image, tiff.samples, tiff.samplesperpixel, tiff.bitspersample, tiff.stride, 0);
/* We should only do this on non-pre-multiplied images, but files in the wild are bad */
+ /* TODO: check if any samples are non-premul to detect bad files */
if (tiff.extrasamples /* == 2 */)
- {
- image = fz_ensure_pixmap_is_additive(ctx, image);
fz_premultiply_pixmap(ctx, image);
- }
}
fz_always(ctx)
{
diff --git a/source/fitz/pixmap.c b/source/fitz/pixmap.c
index d89889fd..21e75764 100644
--- a/source/fitz/pixmap.c
+++ b/source/fitz/pixmap.c
@@ -676,9 +676,6 @@ fz_premultiply_pixmap(fz_context *ctx, fz_pixmap *pix)
if (!pix->alpha)
return;
- if (fz_colorspace_is_subtractive(ctx, pix->colorspace))
- fz_throw(ctx, FZ_ERROR_GENERIC, "cannot pre-multiply subtractive colors");
-
for (y = 0; y < pix->h; y++)
{
for (x = 0; x < pix->w; x++)