diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-12-27 23:51:38 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-12-28 02:07:42 +0100 |
commit | af2eb411d92028b50f5b54b4b69bbc73cc0cae34 (patch) | |
tree | 43d2532c4b4520b9e3ff9df26377f908e7a78f21 /fiv-browser.c | |
parent | 004919cbc5d5ca1107df4d48a9076c666260e5fc (diff) | |
download | fiv-af2eb411d92028b50f5b54b4b69bbc73cc0cae34.tar.gz fiv-af2eb411d92028b50f5b54b4b69bbc73cc0cae34.tar.xz fiv-af2eb411d92028b50f5b54b4b69bbc73cc0cae34.zip |
Try to regenerate low quality thumbnails
Diffstat (limited to 'fiv-browser.c')
-rw-r--r-- | fiv-browser.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fiv-browser.c b/fiv-browser.c index 597fc85..b85caeb 100644 --- a/fiv-browser.c +++ b/fiv-browser.c @@ -351,6 +351,8 @@ rescale_thumbnail(cairo_surface_t *thumbnail, double row_height) pixman_image_unref(src); pixman_image_unref(dest); + cairo_surface_set_user_data( + scaled, &fiv_io_key_thumbnail_lq, (void *) (intptr_t) 1, NULL); cairo_surface_destroy(thumbnail); cairo_surface_mark_dirty(scaled); return scaled; @@ -490,6 +492,7 @@ on_thumbnailer_ready(GObject *object, GAsyncResult *res, gpointer user_data) static void thumbnailer_next(FivBrowser *self) { + // TODO(p): At least launch multiple thumbnailers in parallel. GList *link = self->thumbnail_queue; if (!link) return; @@ -540,15 +543,17 @@ thumbnailer_start(FivBrowser *self) { thumbnailer_abort(self); - // TODO(p): Also collect rescaled images. - GList *missing = NULL, *rescaled = NULL; + GList *missing = NULL, *lq = NULL; for (guint i = self->entries->len; i--; ) { Entry *entry = &g_array_index(self->entries, Entry, i); if (entry->icon) missing = g_list_prepend(missing, entry); + else if (cairo_surface_get_user_data( + entry->thumbnail, &fiv_io_key_thumbnail_lq)) + lq = g_list_prepend(lq, entry); } - self->thumbnail_queue = g_list_concat(missing, rescaled); + self->thumbnail_queue = g_list_concat(missing, lq); thumbnailer_next(self); } |