plug-ins/common/file-jp2-load: Check for other kinds of alpha components

ImageMagick seems to write out the 'matte' component (number 3).
This commit is contained in:
Mukund Sivaraman 2010-10-18 19:19:59 +05:30
parent 5b64b83569
commit 9bbcf8c6b3
1 changed files with 5 additions and 0 deletions

View File

@ -267,6 +267,11 @@ load_image (const gchar *filename,
return -1; return -1;
} }
components[3] = jas_image_getcmptbytype (image, JAS_IMAGE_CT_OPACITY); components[3] = jas_image_getcmptbytype (image, JAS_IMAGE_CT_OPACITY);
/* ImageMagick seems to write out the 'matte' component (number 3) */
if (components[3] == -1)
components[3] = jas_image_getcmptbytype (image, 3);
if (components[3] != -1) if (components[3] != -1)
{ {
num_components = 4; num_components = 4;