Skip to content

Commit

Permalink
Fix thumbnail creation for local files
Browse files Browse the repository at this point in the history
This fixes a regression by linuxmint@1c526f6 that causes thumbnails for local files to not be created because the thumbnailer didn't get an uri.
  • Loading branch information
Cobinja authored and mtwebster committed Sep 21, 2023
1 parent 251dec8 commit 219cdf4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libnemo-private/nemo-thumbnails.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ thumbnail_thread (gpointer data,
NemoThumbnailInfo *info = (NemoThumbnailInfo *) data;
GdkPixbuf *pixbuf;
time_t current_time;
gchar *image_uri = NULL;
gchar *image_uri = info->image_uri;
gboolean free_uri = FALSE;

if (g_cancellable_is_cancelled (cancellable) || info->cancelled) {
DEBUG ("Skipping cancelled file: %s", info->image_uri);
Expand Down Expand Up @@ -347,6 +348,7 @@ thumbnail_thread (gpointer data,
if (eel_uri_is_network (info->image_uri)) {
GFile *file = g_file_new_for_uri (info->image_uri);
GError *err = NULL;
free_uri = TRUE;

image_uri = g_filename_to_uri (g_file_peek_path (file), NULL, &err);

Expand All @@ -368,8 +370,9 @@ thumbnail_thread (gpointer data,
pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (thumbnail_factory,
image_uri,
info->mime_type);

g_free (image_uri);
if (free_uri) {
g_free (image_uri);
}

if (pixbuf) {
gnome_desktop_thumbnail_factory_save_thumbnail (thumbnail_factory,
Expand Down

0 comments on commit 219cdf4

Please sign in to comment.