--- ImageMagick-6.0.8/coders/jp2.c_orig 2004-10-28 12:52:41.000000000 +0200 +++ ImageMagick-6.0.8/coders/jp2.c 2004-10-28 12:53:50.000000000 +0200 @@ -370,6 +370,30 @@ break; } case JAS_CLRSPC_FAM_YCBCR: + { + components[0]=jas_image_getcmptbytype(jp2_image, + JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_Y)); + components[1]=jas_image_getcmptbytype(jp2_image, + JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_CB)); + components[2]=jas_image_getcmptbytype(jp2_image, + JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_CR)); + if ((components[0] < 0) || (components[1] < 0) || (components[2] < 0)) + { + (void) jas_stream_close(jp2_stream); + jas_image_destroy(jp2_image); + ThrowReaderException(CorruptImageError,"MissingImageChannel"); + } + number_components=3; + components[3]=jas_image_getcmptbytype(jp2_image, + JAS_IMAGE_CT_COLOR(JAS_IMAGE_CT_OPACITY)); + if (components[3] > 0) + { + image->matte=MagickTrue; + number_components++; + } + (void) SetImageColorspace(image,YCbCrColorspace); + break; + } default: { (void) jas_stream_close(jp2_stream);