diff options
author | Bastien Nocera <hadess@hadess.net> | 2016-06-26 14:15:59 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2016-12-12 16:36:21 +0100 |
commit | 42d762043852cd7ea247b0bf16ea470e222ce7a9 (patch) | |
tree | 65bff2557f1ac0aea505f58c158cd86d4a44eda8 /thumbnailer | |
parent | 6afda9c24af1a69ac5394d269a6a5c7778cfa128 (diff) | |
download | gdk-pixbuf-42d762043852cd7ea247b0bf16ea470e222ce7a9.tar.gz |
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
Diffstat (limited to 'thumbnailer')
-rw-r--r-- | 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 2b6541e70..0ac93d239 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; |