From 22a627d02fd8d7c5564b89b739cbf368a3049c78 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 29 Jun 2024 19:13:00 +0200 Subject: Add support for x-large and xx-large XDG thumbnail directories --- src/thumbnail.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/thumbnail.c b/src/thumbnail.c index 77c0acd..79e5035 100644 --- a/src/thumbnail.c +++ b/src/thumbnail.c @@ -183,8 +183,6 @@ void init_thumbnail_mode(void) winwidget_show(winwid); } - /* make sure we have an ~/.thumbnails/normal directory for storing - permanent thumbnails */ td.cache_thumbnails = opt.cache_thumbnails; if (td.cache_thumbnails) { @@ -193,9 +191,15 @@ void init_thumbnail_mode(void) else td.cache_dim = opt.thumb_h; - if (td.cache_dim > 256) { - /* No caching as specified by standard. Sort of. */ + if (td.cache_dim > 1024) { + /* Not specified by XDG thumbnail standard */ td.cache_thumbnails = 0; + } else if (td.cache_dim > 512) { + td.cache_dim = 1024; + td.cache_dir = estrdup("xx-large"); + } else if (td.cache_dim > 256) { + td.cache_dim = 512; + td.cache_dir = estrdup("x-large"); } else if (td.cache_dim > 128) { td.cache_dim = 256; td.cache_dir = estrdup("large"); -- cgit v1.2.3