summaryrefslogtreecommitdiff
path: root/src/filelist.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2012-10-13 16:26:53 +0200
committerDaniel Friesel <derf@finalrewind.org>2012-10-13 16:26:53 +0200
commit906ec657cdd958b25a6833f644a57bcf08c3a38b (patch)
treea35c4fb6e9374399e8e60ffeae2fa7d294b56ca7 /src/filelist.c
parent8caf865bf7468e335559218305a202425fa99162 (diff)
Add --min-dimension and --max-dimension options (closes #101)
Diffstat (limited to 'src/filelist.c')
-rw-r--r--src/filelist.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/filelist.c b/src/filelist.c
index 920a5ef..542dbdf 100644
--- a/src/filelist.c
+++ b/src/filelist.c
@@ -281,6 +281,13 @@ gib_list *feh_file_info_preload(gib_list * list)
remove_list = gib_list_add_front(remove_list, l);
if (opt.verbose)
feh_display_status('x');
+ } else if (((unsigned int)file->info->width < opt.min_width)
+ || ((unsigned int)file->info->width > opt.max_width)
+ || ((unsigned int)file->info->height < opt.min_height)
+ || ((unsigned int)file->info->height > opt.max_height)) {
+ remove_list = gib_list_add_front(remove_list, l);
+ if (opt.verbose)
+ feh_display_status('s');
} else if (opt.verbose)
feh_display_status('.');
}
@@ -375,7 +382,8 @@ int feh_cmp_format(void *file1, void *file2)
void feh_prepare_filelist(void)
{
if (opt.list || opt.customlist || (opt.sort > SORT_FILENAME)
- || opt.preload) {
+ || opt.preload || opt.min_width || opt.min_height
+ || (opt.max_width != UINT_MAX) || (opt.max_height != UINT_MAX)) {
/* For these sort options, we have to preload images */
filelist = feh_file_info_preload(filelist);
if (!gib_list_length(filelist))