Index: app/core/Makefile.am
===================================================================
--- app/core/Makefile.am	(revision 25900)
+++ app/core/Makefile.am	(working copy)
@@ -11,6 +11,7 @@ INCLUDES = \
 	-I$(top_srcdir)/app	\
 	$(GDK_PIXBUF_CFLAGS)	\
 	$(CAIRO_CFLAGS)		\
+	$(GIO_CFLAGS)		\
 	$(GLIB_CFLAGS)		\
 	$(GEGL_CFLAGS)		\
 	-I$(includedir)
Index: app/core/gimpimagefile.c
===================================================================
--- app/core/gimpimagefile.c	(revision 25900)
+++ app/core/gimpimagefile.c	(working copy)
@@ -25,6 +25,7 @@
 
 #include <string.h>
 
+#include <gio/gio.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -254,6 +255,29 @@ gimp_imagefile_create_thumbnail (GimpIma
       const gchar  *mime_type = NULL;
       GError       *error     = NULL;
 
+      GFile        *file;
+      GFileInfo    *file_info;
+      gboolean      regular;
+      gboolean      readable;
+
+      /*  we only want to attempt thumbnailing on readable, regular files  */
+      file      = g_file_new_for_uri (thumbnail->image_uri);
+      file_info = g_file_query_info (file,
+                                     G_FILE_ATTRIBUTE_STANDARD_TYPE ","
+                                     G_FILE_ATTRIBUTE_ACCESS_CAN_READ,
+                                     G_FILE_QUERY_INFO_NONE,
+                                     NULL, NULL);
+
+      regular  = (g_file_info_get_file_type (file_info) == G_FILE_TYPE_REGULAR);
+      readable = g_file_info_get_attribute_boolean (file_info,
+                                                    G_FILE_ATTRIBUTE_ACCESS_CAN_READ);
+
+      g_object_unref (file_info);
+      g_object_unref (file);
+
+      if (! (regular && readable))
+        return;
+
       g_object_ref (imagefile);
 
       image = file_open_thumbnail (imagefile->gimp, context, progress,
Index: app/widgets/gimpthumbbox.c
===================================================================
--- app/widgets/gimpthumbbox.c	(revision 25900)
+++ app/widgets/gimpthumbbox.c	(working copy)
@@ -665,22 +665,9 @@ gimp_thumb_box_create_thumbnail (GimpThu
                                  gboolean           force,
                                  GimpProgress      *progress)
 {
-  gchar         *filename = file_utils_filename_from_uri (uri);
-  GimpThumbnail *thumb;
+  GimpThumbnail *thumb = box->imagefile->thumbnail;
   gchar         *basename;
 
-  if (filename)
-    {
-      gboolean regular = g_file_test (filename, G_FILE_TEST_IS_REGULAR);
-
-      g_free (filename);
-
-      if (! regular)
-        return;
-    }
-
-  thumb = box->imagefile->thumbnail;
-
   basename = file_utils_uri_display_basename (uri);
   gtk_label_set_text (GTK_LABEL (box->filename), basename);
   g_free (basename);
Index: app/Makefile.am
===================================================================
--- app/Makefile.am	(revision 25900)
+++ app/Makefile.am	(working copy)
@@ -137,6 +137,7 @@ gimp_2_5_LDADD = \
 	$(FONTCONFIG_LIBS)		\
 	$(FREETYPE_LIBS)		\
 	$(DBUS_GLIB_LIBS)		\
+	$(GIO_LIBS)			\
 	$(GEGL_LIBS)			\
 	$(RT_LIBS)			\
 	$(INTLLIBS)			\
