[gimp] plug-ins: get rid of babl_format() in file-webp.



commit 9d54d81a8c08980c493a2e5e28553e48094ef90d
Author: Jehan <jehan girinstud io>
Date:   Wed Jul 17 13:55:19 2019 +0200

    plug-ins: get rid of babl_format() in file-webp.
    
    Same as commit 74abdfa377, this time for file-webp.

 plug-ins/file-webp/file-webp-save.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/plug-ins/file-webp/file-webp-save.c b/plug-ins/file-webp/file-webp-save.c
index ad02c443f4..e58b0e8bfe 100644
--- a/plug-ins/file-webp/file-webp-save.c
+++ b/plug-ins/file-webp/file-webp-save.c
@@ -154,6 +154,7 @@ save_layer (const gchar    *filename,
   guchar           *buffer   = NULL;
   gint              w, h;
   gboolean          has_alpha;
+  const gchar      *encoding;
   const Babl       *format;
   const Babl       *space      = NULL;
   gint              bpp;
@@ -215,19 +216,19 @@ save_layer (const gchar    *filename,
       if (has_alpha)
         {
           if (out_linear)
-            format = babl_format ("RGBA u8");
+            encoding = "RGBA u8";
           else
-            format = babl_format ("R'G'B'A u8");
+            encoding = "R'G'B'A u8";
         }
       else
         {
           if (out_linear)
-            format = babl_format ("RGB u8");
+            encoding = "RGB u8";
           else
-            format = babl_format ("R'G'B' u8");
+            encoding = "R'G'B' u8";
         }
 
-      format = babl_format_with_space (babl_format_get_encoding (format), space);
+      format = babl_format_with_space (encoding, space);
       bpp = babl_format_get_bytes_per_pixel (format);
 
       /* Retrieve the buffer for the layer */
@@ -513,6 +514,7 @@ save_animation (const gchar    *filename,
   gint                   w, h;
   gint                   bpp;
   gboolean               has_alpha;
+  const gchar           *encoding;
   const Babl            *format;
   const Babl            *space   = NULL;
   GimpColorProfile      *profile = NULL;
@@ -609,19 +611,19 @@ save_animation (const gchar    *filename,
           if (has_alpha)
             {
               if (out_linear)
-                format = babl_format ("RGBA u8");
+                encoding = "RGBA u8";
               else
-                format = babl_format ("R'G'B'A u8");
+                encoding = "R'G'B'A u8";
             }
           else
             {
               if (out_linear)
-                format = babl_format ("RGB u8");
+                encoding = "RGB u8";
               else
-                format = babl_format ("R'G'B' u8");
+                encoding = "R'G'B' u8";
             }
 
-          format = babl_format_with_space (babl_format_get_encoding (format), space);
+          format = babl_format_with_space (encoding, space);
           bpp = babl_format_get_bytes_per_pixel (format);
 
           /* fix layers to avoid offset errors */


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