]> granicus.if.org Git - openjpeg/commitdiff
[trunk] enhance the support of sYCC into opj_decompress application (thanks winfried).
authorMickael Savinaud <savmickael@users.noreply.github.com>
Sun, 24 Mar 2013 23:12:41 +0000 (23:12 +0000)
committerMickael Savinaud <savmickael@users.noreply.github.com>
Sun, 24 Mar 2013 23:12:41 +0000 (23:12 +0000)
src/bin/jp2/opj_decompress.c

index 0c65d85286369ac21325a4bad3676226cf2f5ac2..b2e4e83cfbb2efcf61ebcc1495a63b9edb3cc1a0 100644 (file)
@@ -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)