[gimp/gimp-2-10] plug-ins: When exporting BMP with color space info, always include color masks.



commit 0a55c44705beb16d60f90ce6ed3192b6790ad67f
Author: Sebastian Rasmussen <sebras gmail com>
Date:   Thu Oct 31 16:41:36 2019 +0100

    plug-ins: When exporting BMP with color space info, always include color masks.
    
    This fixes issue #4155.
    
    (cherry picked from commit 9727a38977c0880dc54a7bd6615c8448fd477492)

 plug-ins/file-bmp/bmp-save.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/file-bmp/bmp-save.c b/plug-ins/file-bmp/bmp-save.c
index 2ba46eb1a1..c8abc36214 100644
--- a/plug-ins/file-bmp/bmp-save.c
+++ b/plug-ins/file-bmp/bmp-save.c
@@ -346,9 +346,15 @@ save_image (const gchar  *filename,
     SpZeile = ((gint) (((Spcols * BitsPerPixel) / 8) / 4) + 1) * 4;
 
   if (! BMPSaveData.dont_write_color_space_data)
-    color_space_size = 68;
+    {
+      /* Always include color mask for BITMAPV5HEADER, see #4155. */
+      mask_info_size = 16;
+      color_space_size = 68;
+    }
   else
-    color_space_size = 0;
+    {
+      color_space_size = 0;
+    }
 
   bitmap_file_head.bfSize    = (0x36 + MapSize + (rows * SpZeile) +
                                 mask_info_size + color_space_size);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]