[gegl] bin: permit passing sink node as part of -- chain



commit b60a87e50e1e0ae94236b1ac8734f2d12d9c11b0
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Nov 29 03:25:52 2018 +0100

    bin: permit passing sink node as part of -- chain

 bin/gegl.c | 10 +++++++++-
 bin/ui.c   |  8 +++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/bin/gegl.c b/bin/gegl.c
index 93f95fe63..8d9c10cb4 100644
--- a/bin/gegl.c
+++ b/bin/gegl.c
@@ -204,6 +204,7 @@ main (gint    argc,
         }
     }
 
+
   if (o->mode == GEGL_RUN_MODE_DISPLAY)
     {
 #if HAVE_MRG
@@ -228,12 +229,19 @@ main (gint    argc,
   GeglNode *iter = gegl_node_get_producer (proxy, "input", NULL);
   if (o->rest)
     {
-      GError *error = NULL;
+      GeglNode *ret_sink = NULL;
+
+      GError *error = (void*)(&ret_sink);
       gegl_create_chain_argv (o->rest, iter, proxy, 0, gegl_node_get_bounding_box (gegl).height, path_root, 
&error);
       if (error)
       {
         fprintf (stderr, "Error: %s\n", error->message);
       }
+      if (ret_sink)
+      {
+        gegl_node_process (ret_sink);
+        exit(0);
+      }
       if (o->serialize)
       {
         fprintf (stderr, "%s\n", gegl_serialize (iter,
diff --git a/bin/ui.c b/bin/ui.c
index 3132f3c28..ae2b650b0 100644
--- a/bin/ui.c
+++ b/bin/ui.c
@@ -1321,7 +1321,8 @@ static void load_path (State *o)
   }
   if (o->ops)
   {
-    GError *error = NULL;
+    GeglNode *ret_sink = NULL;
+    GError *error = (void*)(&ret_sink);
 
     char *containing_path = get_path_parent (o->path);
     gegl_create_chain_argv (o->ops,
@@ -1334,6 +1335,11 @@ static void load_path (State *o)
     {
       fprintf (stderr, "Error: %s\n", error->message);
     }
+    if (ret_sink)
+    {
+      gegl_node_process (ret_sink);
+      exit(0);
+    }
 
     zoom_to_fit (o);
   }


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