From: Cristy Date: Sat, 25 Mar 2017 18:02:52 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/409 X-Git-Tag: 7.0.5-5~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bdccfcdd7d50102120d3d1d6de91956ae8d46ea8;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/409 --- diff --git a/coders/jp2.c b/coders/jp2.c index f0d821c75..1cf68e007 100644 --- a/coders/jp2.c +++ b/coders/jp2.c @@ -403,17 +403,17 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception) if (status == MagickFalse) return(DestroyImageList(image)); image->compression=JPEG2000Compression; - if (jp2_image->numcomps <= 2) + if (jp2_image->color_space == 2) { SetImageColorspace(image,GRAYColorspace,exception); if (jp2_image->numcomps > 1) image->alpha_trait=BlendPixelTrait; } + else + if (jp2_image->color_space == 3) + SetImageColorspace(image,Rec601YCbCrColorspace,exception); if (jp2_image->numcomps > 3) image->alpha_trait=BlendPixelTrait; - for (i=0; i < (ssize_t) jp2_image->numcomps; i++) - if ((jp2_image->comps[i].dx > 1) || (jp2_image->comps[i].dy > 1)) - SetImageColorspace(image,YUVColorspace,exception); if (jp2_image->icc_profile_buf != (unsigned char *) NULL) { StringInfo