Can't read transparent BMP images
Posted: 2012-11-21T10:06:24-07:00
Version 6.8.0-4 supports the transparency in the these BMP images: rgba16-4444.bmp rgba32.bmp, but 6.8.0-5 does not.
Here's what changed in the code:
I suggest this instead:
Although Microsoft's documentation implies that the alpha_mask field is valid for BI_RGB images, it also says what all the bits are used for, and leaves none of them available for an alpha mask. If you want to try to allow some BI_RGB images to have transparency, I wouldn't object, but I don't think it's necessary, and it would have to be done very carefully.
Here's what changed in the code:
Code: Select all
6.8.0-4:coders/bmp.c:846
image->matte=(bmp_info.alpha_mask != 0) ||
((bmp_info.compression == BI_RGB) && (bmp_info.bits_per_pixel == 32)) ?
MagickTrue : MagickFalse;
6.8.0-5:
image->matte=(bmp_info.alpha_mask != 0) &&
((bmp_info.compression == BI_RGB) && (bmp_info.bits_per_pixel == 32)) ?
MagickTrue : MagickFalse;
Code: Select all
image->matte=(bmp_info.alpha_mask != 0) &&
(bmp_info.compression == BI_BITFIELDS) ?
MagickTrue : MagickFalse;