[gegl] grey: propagate BablSpace



commit 80fed62ab6c0a50b6bc4a7405242874ff8246058
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Jul 5 15:57:35 2018 +0200

    grey: propagate BablSpace

 operations/common/grey.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/operations/common/grey.c b/operations/common/grey.c
index 6bc5150de..9a19a259e 100644
--- a/operations/common/grey.c
+++ b/operations/common/grey.c
@@ -35,22 +35,17 @@
 
 static void prepare (GeglOperation *operation)
 {
+  const Babl *space = gegl_operation_get_source_space (operation, "input");
   const Babl *format;
   const Babl *input_format;
 
   input_format = gegl_operation_get_source_format (operation, "input");
-  if (input_format == NULL)
-    {
-      format = babl_format ("YA float");
-      goto out;
-    }
 
-  if (babl_format_has_alpha (input_format))
-    format = babl_format ("YA float");
+  if (input_format && babl_format_has_alpha (input_format))
+    format = babl_format_with_space ("YA float", space);
   else
-    format = babl_format ("Y float");
+    format = babl_format_with_space ("Y float", space);
 
- out:
   gegl_operation_set_format (operation, "input", format);
   gegl_operation_set_format (operation, "output", format);
 }


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