From 7b7e2a607614ffd14774a350ec0f4570149c7465 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sun, 30 Oct 2016 01:19:59 +0800 Subject: jpx: Only do YCC-to-RGB conversion if decoding image samples. --- source/fitz/load-jpx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c index 583aec02..17e78d7e 100644 --- a/source/fitz/load-jpx.c +++ b/source/fitz/load-jpx.c @@ -852,6 +852,9 @@ jpx_read_image(fz_context *ctx, unsigned char *data, size_t size, fz_colorspace } } + if (jpx->color_space == OPJ_CLRSPC_SYCC && n == 3 && a == 0) + jpx_ycc_to_rgb(ctx, img, 1, 1); + if (a) { /* CMYK is a subtractive colorspace, we want additive for premul alpha */ @@ -865,9 +868,6 @@ jpx_read_image(fz_context *ctx, unsigned char *data, size_t size, fz_colorspace } } - if (jpx->color_space == OPJ_CLRSPC_SYCC && n == 3 && a == 0) - jpx_ycc_to_rgb(ctx, img, 1, 1); - opj_image_destroy(jpx); return img; -- cgit v1.2.3