[gnome-photos/wip/rishi/imageview: 1/5] 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/imageview: 1/5] Add a format parameter to photos_utils_create_buffer_from_node
- Date: Tue, 17 Jan 2017 05:59:34 +0000 (UTC)
commit d9a0f05af488f697e959d7249df9c24c05731828
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Jan 17 06:14:37 2017 +0100
Add a format parameter to photos_utils_create_buffer_from_node
src/photos-base-item.c | 6 +++---
src/photos-utils.c | 3 ++-
src/photos-utils.h | 3 ++-
3 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index cf1e9d6..cf0113e 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -1116,7 +1116,7 @@ photos_base_item_guess_save_sizes_load (GObject *source_object, GAsyncResult *re
goto out;
}
- 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, 0.0);
g_task_set_task_data (task, data, (GDestroyNotify) photos_base_item_save_data_free);
@@ -2064,7 +2064,7 @@ photos_base_item_save_to_stream_load (GObject *source_object, GAsyncResult *res,
goto out;
}
- buffer = photos_utils_create_buffer_from_node (graph);
+ buffer = photos_utils_create_buffer_from_node (graph, NULL);
photos_utils_buffer_zoom_async (buffer,
data->zoom,
cancellable,
@@ -3668,7 +3668,7 @@ photos_base_item_save_load (GObject *source_object, GAsyncResult *res, gpointer
goto out;
}
- buffer = photos_utils_create_buffer_from_node (graph);
+ buffer = photos_utils_create_buffer_from_node (graph, NULL);
photos_utils_buffer_zoom_async (buffer,
data->zoom,
cancellable,
diff --git a/src/photos-utils.c b/src/photos-utils.c
index 0b0a0a6..91cfea4 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -286,7 +286,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;
@@ -296,6 +296,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 8a85055..f31af2f 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>
@@ -81,7 +82,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]