diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-02-14 22:33:38 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-02-14 22:33:38 +0100 |
commit | 5e75b5ef3e7d0270913c04645398bc3596c2a90a (patch) | |
tree | 6a6c396f017f4e4c10794d74e3550481be580477 /src/slideshow.c | |
parent | 202e6e6d35654010a308017f1c9c8b3e8000c970 (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/slideshow.c')
-rw-r--r-- | src/slideshow.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/slideshow.c b/src/slideshow.c index 6ab56fa..d56c1b6 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -361,17 +361,15 @@ void slideshow_change_image(winwidget winwid, int change, int render) } if (winwidget_loadimage(winwid, FEH_FILE(current_file->data))) { - unsigned int w = gib_imlib_image_get_width(winwid->im); - unsigned int h = gib_imlib_image_get_height(winwid->im); - if (opt.min_width || opt.min_height || (opt.max_width != UINT_MAX) || (opt.max_height != UINT_MAX)) { - if (w < opt.min_width || w > opt.max_width || h < opt.min_height || h > opt.max_height) { - last = current_file; - continue; - } + int w = gib_imlib_image_get_width(winwid->im); + int h = gib_imlib_image_get_height(winwid->im); + if (feh_should_ignore_image(winwid->im)) { + last = current_file; + continue; } winwid->mode = MODE_NORMAL; winwid->file = current_file; - if ((winwid->im_w != (int)w) || (winwid->im_h != (int)h)) + if ((winwid->im_w != w) || (winwid->im_h != h)) winwid->had_resize = 1; winwidget_reset_image(winwid); winwid->im_w = w; |