From bf0fa4089fa33a4447054ff883acc92da604de52 Mon Sep 17 00:00:00 2001 From: Mickael Savinaud Date: Sun, 24 Mar 2013 23:12:41 +0000 Subject: [PATCH] [trunk] enhance the support of sYCC into opj_decompress application (thanks winfried). --- src/bin/jp2/opj_decompress.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bin/jp2/opj_decompress.c b/src/bin/jp2/opj_decompress.c index 0c65d852..b2e4e83c 100644 --- a/src/bin/jp2/opj_decompress.c +++ b/src/bin/jp2/opj_decompress.c @@ -850,6 +850,13 @@ int main(int argc, char **argv) if(image->color_space == OPJ_CLRSPC_SYCC){ color_sycc_to_rgb(image); /* FIXME */ } + + if( image->color_space != OPJ_CLRSPC_SYCC + && image->numcomps == 3 && image->comps[0].dx == image->comps[0].dy + && image->comps[1].dx != 1 ) + image->color_space = OPJ_CLRSPC_SYCC; + else if (image->numcomps <= 2) + image->color_space = OPJ_CLRSPC_GRAY; if(image->icc_profile_buf) { #if defined(OPJ_HAVE_LIBLCMS1) || defined(OPJ_HAVE_LIBLCMS2)