summaryrefslogtreecommitdiff
path: root/src/imlib.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/imlib.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/imlib.c')
-rw-r--r--src/imlib.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/imlib.c b/src/imlib.c
index 6de6bdb..d9c5cd0 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -139,6 +139,18 @@ void init_x_and_imlib(void)
return;
}
+int feh_should_ignore_image(Imlib_Image * im)
+{
+ if (opt.filter_by_dimensions) {
+ unsigned int w = gib_imlib_image_get_width(im);
+ unsigned int h = gib_imlib_image_get_height(im);
+ if (w < opt.min_width || w > opt.max_width || h < opt.min_height || h > opt.max_height) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
int feh_load_image_char(Imlib_Image * im, char *filename)
{
feh_file *file;