mirror of https://github.com/GNOME/gimp.git
plug-ins: fix #6144 Unrecognised or invalid BMP compression format.
The Microsoft specification for BITMAPV5HEADER says that BI_BITFIELDS is valid for 16 and 32-bits per pixel, but we were also using this flag for other values of bpp when no rle compression was used. Since this specification doesn't mention 24 bpp or other values use BI_RGB instead.
This commit is contained in:
parent
e96dba41f4
commit
d8c164ced3
|
@ -377,7 +377,11 @@ save_image (GFile *file,
|
|||
|
||||
if (! use_rle)
|
||||
{
|
||||
if (mask_info_size > 0)
|
||||
/* The Microsoft specification for BITMAPV5HEADER says that
|
||||
* BI_BITFIELDS is valid for 16 and 32-bits per pixel,
|
||||
* Since it doesn't mention 24 bpp or other numbers
|
||||
* use BI_RGB for that. See issue #6114. */
|
||||
if (mask_info_size > 0 && (BitsPerPixel == 16 || BitsPerPixel == 32))
|
||||
bitmap_head.biCompr = 3; /* BI_BITFIELDS */
|
||||
else
|
||||
bitmap_head.biCompr = 0; /* BI_RGB */
|
||||
|
|
Loading…
Reference in New Issue