[gnome-photos/wip/rishi/buffer-decoder: 8/8] base-item: ...



commit 5565ae1be34910a7884939963c105cdb1208dc31
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Sep 6 11:06:01 2018 +0200

    base-item: ...
    
    https://gitlab.gnome.org/GNOME/gnome-photos/issues/63

 src/photos-base-item.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index d605634f..03cde624 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -46,6 +46,7 @@
 #include "photos-error.h"
 #include "photos-filterable.h"
 #include "photos-gegl.h"
+#include "photos-gegl-buffer-io.h"
 #include "photos-glib.h"
 #include "photos-local-item.h"
 #include "photos-pipeline.h"
@@ -1464,10 +1465,6 @@ photos_base_item_load_buffer (PhotosBaseItem *self, GCancellable *cancellable, G
   g_autoptr (GFile) file = NULL;
   g_autoptr (GeglBuffer) buffer = NULL;
   GeglBuffer *ret_val = NULL;
-  GeglNode *buffer_sink;
-  g_autoptr (GeglNode) graph = NULL;
-  GeglNode *load;
-  g_autofree gchar *path = NULL;
   gint64 end;
   gint64 start;
 
@@ -1477,17 +1474,12 @@ photos_base_item_load_buffer (PhotosBaseItem *self, GCancellable *cancellable, G
   if (file == NULL)
     goto out;
 
-  path = g_file_get_path (file);
-
-  graph = gegl_node_new ();
-  load = gegl_node_new_child (graph, "operation", "gegl:load", "path", path, NULL);
-  buffer_sink = gegl_node_new_child (graph, "operation", "gegl:buffer-sink", "buffer", &buffer, NULL);
-
-  gegl_node_link (load, buffer_sink);
-
   start = g_get_monotonic_time ();
 
-  gegl_node_process (buffer_sink);
+  buffer = photos_gegl_buffer_new_from_file (file, cancellable, error);
+  if (buffer == NULL)
+    goto out;
+
   ret_val = photos_gegl_buffer_apply_orientation (buffer, priv->orientation);
 
   end = g_get_monotonic_time ();


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