[gimp/gimp-2-10] plug-ins: space invasion leaked into 2.10 file-heif, but incompletely



commit 9f3823ca6bf8ba26a0e5e0e323acc72cd123e397
Author: Michael Natterer <mitch gimp org>
Date:   Fri Jul 5 01:47:43 2019 +0200

    plug-ins: space invasion leaked into 2.10 file-heif, but incompletely
    
    merge the remaining diff to master so it builds again.

 plug-ins/common/file-heif.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/common/file-heif.c b/plug-ins/common/file-heif.c
index 3f60b3e773..b160710d01 100644
--- a/plug-ins/common/file-heif.c
+++ b/plug-ins/common/file-heif.c
@@ -560,9 +560,11 @@ load_image (GFile     *file,
   buffer = gimp_drawable_get_buffer (layer_ID);
 
   if (has_alpha)
-    format = babl_format ("R'G'B'A u8");
+    format = babl_format_with_space ("R'G'B'A u8",
+                                     gegl_buffer_get_format (buffer));
   else
-    format = babl_format ("R'G'B' u8");
+    format = babl_format_with_space ("R'G'B' u8",
+                                     gegl_buffer_get_format (buffer));
 
   data = heif_image_get_plane_readonly (img, heif_channel_interleaved,
                                         &stride);
@@ -690,6 +692,7 @@ save_image (GFile             *file,
   GOutputStream            *output;
   GeglBuffer               *buffer;
   const Babl               *format;
+  const Babl               *space   = NULL;
   guint8                   *data;
   gint                      stride;
   gint                      width;
@@ -763,6 +766,9 @@ save_image (GFile             *file,
     }
 #endif /* HAVE_LIBHEIF_1_4_0 */
 
+  if (! space)
+    space = gimp_drawable_get_format (drawable_ID);
+
   heif_image_add_plane (image, heif_channel_interleaved,
                         width, height, has_alpha ? 32 : 24);
 
@@ -784,6 +790,7 @@ save_image (GFile             *file,
       else
         format = babl_format ("R'G'B' u8");
     }
+  format = babl_format_with_space (babl_format_get_encoding (format), space);
 
   gegl_buffer_get (buffer,
                    GEGL_RECTANGLE (0, 0, width, height),


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