[gdk-pixbuf] thumbnail: Let the caller handle preview icons
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] thumbnail: Let the caller handle preview icons
- Date: Mon, 12 Dec 2016 15:39:53 +0000 (UTC)
commit 42d762043852cd7ea247b0bf16ea470e222ce7a9
Author: Bastien Nocera <hadess hadess net>
Date: Sun Jun 26 14:15:59 2016 +0200
thumbnail: Let the caller handle preview icons
As we only get called for images, and that preview icons can also be
used for other data types handled natively by external devices, let the
caller handle those.
https://bugzilla.gnome.org/show_bug.cgi?id=768062
thumbnailer/gdk-pixbuf-thumbnailer.c | 31 +++----------------------------
1 files changed, 3 insertions(+), 28 deletions(-)
---
diff --git a/thumbnailer/gdk-pixbuf-thumbnailer.c b/thumbnailer/gdk-pixbuf-thumbnailer.c
index 2b6541e..0ac93d2 100644
--- a/thumbnailer/gdk-pixbuf-thumbnailer.c
+++ b/thumbnailer/gdk-pixbuf-thumbnailer.c
@@ -129,37 +129,12 @@ _gdk_pixbuf_new_from_uri_at_scale (const char *uri,
g_return_val_if_fail (uri != NULL, NULL);
- input_stream = NULL;
-
file = g_file_new_for_uri (uri);
- /* First see if we can get an input stream via preview::icon */
- file_info = g_file_query_info (file,
- G_FILE_ATTRIBUTE_PREVIEW_ICON,
- G_FILE_QUERY_INFO_NONE,
- NULL, /* GCancellable */
- NULL); /* return location for GError */
- if (file_info != NULL) {
- GObject *object;
-
- object = g_file_info_get_attribute_object (file_info,
- G_FILE_ATTRIBUTE_PREVIEW_ICON);
- if (object != NULL && G_IS_LOADABLE_ICON (object)) {
- input_stream = g_loadable_icon_load (G_LOADABLE_ICON (object),
- 0, /* size */
- NULL, /* return location for type */
- NULL, /* GCancellable */
- NULL); /* return location for GError */
- }
- g_object_unref (file_info);
- }
-
+ input_stream = G_INPUT_STREAM (g_file_read (file, NULL, error));
if (input_stream == NULL) {
- input_stream = G_INPUT_STREAM (g_file_read (file, NULL, error));
- if (input_stream == NULL) {
- g_object_unref (file);
- return NULL;
- }
+ g_object_unref (file);
+ return NULL;
}
has_frame = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]