[gnome-photos/wip/rishi/imageview2: 2/6] Add a format parameter to photos_utils_create_buffer_from_node
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/imageview2: 2/6] Add a format parameter to photos_utils_create_buffer_from_node
- Date: Mon, 16 Jan 2017 11:02:42 +0000 (UTC)
commit ff308139fc9f00e9ca7728b9584510f9ef608306
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Feb 2 13:20:06 2016 +0100
Add a format parameter to photos_utils_create_buffer_from_node
src/photos-base-item.c | 4 ++--
src/photos-utils.c | 3 ++-
src/photos-utils.h | 3 ++-
3 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 2152d5f..9998449 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -2319,7 +2319,7 @@ photos_base_item_save_async (PhotosBaseItem *self,
g_task_set_task_data (task, data, (GDestroyNotify) photos_base_item_save_data_free);
graph = photos_pipeline_get_graph (priv->pipeline);
- buffer = photos_utils_create_buffer_from_node (graph);
+ buffer = photos_utils_create_buffer_from_node (graph, NULL);
photos_utils_buffer_zoom_async (buffer,
zoom,
cancellable,
@@ -2366,7 +2366,7 @@ photos_base_item_save_guess_sizes_async (PhotosBaseItem *self,
g_return_if_fail (!gegl_processor_work (priv->processor, NULL));
graph = photos_pipeline_get_graph (priv->pipeline);
- buffer = photos_utils_create_buffer_from_node (graph);
+ buffer = photos_utils_create_buffer_from_node (graph, NULL);
data = photos_base_item_save_data_new (NULL, buffer, priv->mime_type);
diff --git a/src/photos-utils.c b/src/photos-utils.c
index d440afc..a2a14c5 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -246,7 +246,7 @@ photos_utils_convert_path_to_uri (const gchar *path)
GeglBuffer *
-photos_utils_create_buffer_from_node (GeglNode *node)
+photos_utils_create_buffer_from_node (GeglNode *node, const Babl *format)
{
GeglBuffer *buffer = NULL;
GeglNode *buffer_sink;
@@ -256,6 +256,7 @@ photos_utils_create_buffer_from_node (GeglNode *node)
buffer_sink = gegl_node_new_child (graph,
"operation", "gegl:buffer-sink",
"buffer", &buffer,
+ "format", format,
NULL);
gegl_node_link (node, buffer_sink);
gegl_node_process (buffer_sink);
diff --git a/src/photos-utils.h b/src/photos-utils.h
index 7d6aff9..d2255c3 100644
--- a/src/photos-utils.h
+++ b/src/photos-utils.h
@@ -28,6 +28,7 @@
#ifndef PHOTOS_UTILS_H
#define PHOTOS_UTILS_H
+#include <babl/babl.h>
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
@@ -71,7 +72,7 @@ GdkPixbuf *photos_utils_center_pixbuf (GdkPixbuf *pixbuf, gi
gchar *photos_utils_convert_path_to_uri (const gchar *path);
-GeglBuffer *photos_utils_create_buffer_from_node (GeglNode *node);
+GeglBuffer *photos_utils_create_buffer_from_node (GeglNode *node, const Babl *format);
GIcon *photos_utils_create_collection_icon (gint base_size, GList *pixbufs);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]