summaryrefslogtreecommitdiff
path: root/src/filelist.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-02-14 22:33:38 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-02-14 22:33:38 +0100
commit5e75b5ef3e7d0270913c04645398bc3596c2a90a (patch)
tree6a6c396f017f4e4c10794d74e3550481be580477 /src/filelist.c
parent202e6e6d35654010a308017f1c9c8b3e8000c970 (diff)
Only check image dimensions on the fly in multiwindow and slideshow mode
This introduces a new feh_should_ignore_image function which is called at appropriate places in those modes to skip images which are loadable but undesired.
Diffstat (limited to 'src/filelist.c')
-rw-r--r--src/filelist.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/filelist.c b/src/filelist.c
index 0066efd..9a4af27 100644
--- a/src/filelist.c
+++ b/src/filelist.c
@@ -464,7 +464,17 @@ int feh_cmp_format(void *file1, void *file2)
void feh_prepare_filelist(void)
{
- if (opt.list || opt.preload || opt.customlist || (opt.sort > SORT_MTIME)) {
+ /*
+ * list and customlist mode as well as the somewhat more fancy sort modes
+ * need access to file infos. Preloading them is also useful for
+ * list/customlist as --min-dimension/--max-dimension may filter images
+ * which should not be processed.
+ * Finally, if --min-dimension/--max-dimension (-> opt.filter_by_dimensions)
+ * is set and we're in thumbnail mode, we need to filter images first so
+ * we can create a properly sized thumbnail list.
+ */
+ if (opt.list || opt.preload || opt.customlist || (opt.sort > SORT_MTIME)
+ || (opt.filter_by_dimensions && (opt.index || opt.collage || opt.thumbs || opt.bgmode))) {
/* For these sort options, we have to preload images */
filelist = feh_file_info_preload(filelist);
if (!gib_list_length(filelist))