[gegl] operations/common/saturation: Always set input & output formats



commit 68ecc4c713e770cd8a84486f57524bc582737400
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Oct 30 11:46:17 2017 +0100

    operations/common/saturation: Always set input & output formats
    
    Some operations never set their output parameters during "prepare".
    For example, various source operations because the output is only
    known during "process". Support consuming data from such operations by
    defaulting to "CIE Lab alpha".
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789642

 operations/common/saturation.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/operations/common/saturation.c b/operations/common/saturation.c
index 8609d89..84fee29 100644
--- a/operations/common/saturation.c
+++ b/operations/common/saturation.c
@@ -149,7 +149,11 @@ static void prepare (GeglOperation *operation)
 
   input_format = gegl_operation_get_source_format (operation, "input");
   if (input_format == NULL)
-    return;
+    {
+      format = babl_format ("CIE Lab alpha float");
+      o->user_data = process_lab_alpha;
+      goto out;
+    }
 
   input_model = babl_format_get_model (input_format);
 
@@ -182,6 +186,7 @@ static void prepare (GeglOperation *operation)
         }
     }
 
+ 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]