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



commit 4f1ac48dd3f2913e18a5959e0a6ecfe53caef720
Author: Jehan <jehan girinstud io>
Date:   Tue Jul 16 23:42:51 2019 +0200

     plug-ins: get rid of babl_format() in file-jpeg.
    
     Same as previous commits.

 plug-ins/file-jpeg/jpeg-save.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/plug-ins/file-jpeg/jpeg-save.c b/plug-ins/file-jpeg/jpeg-save.c
index d5bc5439fd..23b7017633 100644
--- a/plug-ins/file-jpeg/jpeg-save.c
+++ b/plug-ins/file-jpeg/jpeg-save.c
@@ -272,6 +272,7 @@ save_image (const gchar  *filename,
 
   GimpImageType     drawable_type;
   GeglBuffer       *buffer;
+  const gchar      *encoding;
   const Babl       *format;
   const Babl       *space;
   JpegSubsampling   subsampling;
@@ -405,9 +406,9 @@ save_image (const gchar  *filename,
       has_alpha = FALSE;
 
       if (out_linear)
-        format = babl_format ("RGB u8");
+        encoding = "RGB u8";
       else
-        format = babl_format ("R'G'B' u8");
+        encoding = "R'G'B' u8";
       break;
 
     case GIMP_GRAY_IMAGE:
@@ -416,9 +417,9 @@ save_image (const gchar  *filename,
       has_alpha = FALSE;
 
       if (out_linear)
-        format = babl_format ("Y u8");
+        encoding = "Y u8";
       else
-        format = babl_format ("Y' u8");
+        encoding = "Y' u8";
       break;
 
     case GIMP_RGBA_IMAGE:
@@ -427,9 +428,9 @@ save_image (const gchar  *filename,
       has_alpha = TRUE;
 
       if (out_linear)
-        format = babl_format ("RGB u8");
+        encoding = "RGB u8";
       else
-        format = babl_format ("R'G'B' u8");
+        encoding = "R'G'B' u8";
       break;
 
     case GIMP_GRAYA_IMAGE:
@@ -437,9 +438,9 @@ save_image (const gchar  *filename,
       cinfo.input_components = 2 - 1;
       has_alpha = TRUE;
       if (out_linear)
-        format = babl_format ("Y u8");
+        encoding = "Y u8";
       else
-        format = babl_format ("Y' u8");
+        encoding = "Y' u8";
       break;
 
     case GIMP_INDEXED_IMAGE:
@@ -447,7 +448,7 @@ save_image (const gchar  *filename,
       return FALSE;
     }
 
-  format = babl_format_with_space (babl_format_get_encoding (format), space);
+  format = babl_format_with_space (encoding, space);
 
   /* Step 3: set parameters for compression */
 


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