[gimp] plug-ins: space invade file-heif



commit c356564984c9644b3596010fc1ed7d0799ad86ee
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jun 25 13:53:44 2019 +0200

    plug-ins: space invade file-heif
    
    Use the drawable's space for the load/save formats, to avoid unwanted
    color conversions.

 plug-ins/common/file-heif.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/plug-ins/common/file-heif.c b/plug-ins/common/file-heif.c
index f22963b319..010c0a3f5c 100644
--- a/plug-ins/common/file-heif.c
+++ b/plug-ins/common/file-heif.c
@@ -545,9 +545,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);
@@ -718,9 +720,11 @@ save_image (GFile             *file,
   buffer = gimp_drawable_get_buffer (drawable_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));
 
   gegl_buffer_get (buffer,
                    GEGL_RECTANGLE (0, 0, width, height),


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