Skip to content

Commit

Permalink
support alpha mask
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Sep 10, 2023
1 parent cca3a2c commit 1e67b4a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions coders/bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
#define BI_JPEG 4
#undef BI_PNG
#define BI_PNG 5
#ifndef BI_ALPHABITFIELDS
#define BI_ALPHABITFIELDS 6
#endif
#if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__MINGW32__)
#undef BI_RGB
#define BI_RGB 0
Expand Down Expand Up @@ -809,6 +812,13 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
bmp_info.green_mask=ReadBlobLSBLong(image);
bmp_info.blue_mask=ReadBlobLSBLong(image);
}
if ((bmp_info.size > 40) || (bmp_info.compression == BI_ALPHABITFIELDS))
{
bmp_info.red_mask=ReadBlobLSBLong(image);
bmp_info.green_mask=ReadBlobLSBLong(image);
bmp_info.blue_mask=ReadBlobLSBLong(image);
bmp_info.alpha_mask=ReadBlobLSBLong(image);
}
if (bmp_info.size > 40)
{
double
Expand Down

0 comments on commit 1e67b4a

Please sign in to comment.