From 54c534cdee597e3af2ebc1028db922e5bc3cf0f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lugan?= Date: Wed, 17 Feb 2016 16:25:47 +0100 Subject: [PATCH] Only convert to RGB colorspace when requested --- src/bin/jp2/opj_decompress.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/bin/jp2/opj_decompress.c b/src/bin/jp2/opj_decompress.c index f3b1cd5c..5cac414d 100644 --- a/src/bin/jp2/opj_decompress.c +++ b/src/bin/jp2/opj_decompress.c @@ -1371,16 +1371,6 @@ int main(int argc, char **argv) else if (image->numcomps <= 2) image->color_space = OPJ_CLRSPC_GRAY; - if(image->color_space == OPJ_CLRSPC_SYCC){ - color_sycc_to_rgb(image); - } - else if((image->color_space == OPJ_CLRSPC_CMYK) && (parameters.cod_format != TIF_DFMT)){ - color_cmyk_to_rgb(image); - } - else if(image->color_space == OPJ_CLRSPC_EYCC){ - color_esycc_to_rgb(image); - } - if(image->icc_profile_buf) { #if defined(OPJ_HAVE_LIBLCMS1) || defined(OPJ_HAVE_LIBLCMS2) if(image->icc_profile_len) @@ -1443,6 +1433,16 @@ int main(int argc, char **argv) if (parameters.force_rgb) { switch (image->color_space) { + case OPJ_CLRSPC_SYCC: + color_sycc_to_rgb(image); + break; + case OPJ_CLRSPC_CMYK: + if (parameters.cod_format != TIF_DFMT) + color_cmyk_to_rgb(image); + break; + case OPJ_CLRSPC_EYCC: + color_esycc_to_rgb(image); + break; case OPJ_CLRSPC_SRGB: break; case OPJ_CLRSPC_GRAY: