Feature Request: Minimal Image resolution #101

Closed
helau opened this Issue Oct 7, 2012 · 7 comments

Comments

Projects
None yet
3 participants

helau commented Oct 7, 2012

Hello,
First thanks a lot for your great image viewer.
I use it for slideshows and it would be nice to have an option, for not showing pictures with a resolution smaller than xxx, because in my picture folder there are also a lot of thumbnails, which I do not want to see in the slideshow
Bye
Helmut

Owner

derf commented Oct 12, 2012

Hmm, sounds like an idea. I'll add it eventually.

helau commented Oct 12, 2012

That sounds like a great idea :)
Thanks
Helmut

@derf derf closed this in 906ec65 Oct 13, 2012

GArik commented Oct 19, 2012

Hey, derf! Can you add these options to src/help.raw? Thanks.

helau commented Oct 19, 2012

Thanks for the parameter !
Unfortunately it is not usable for me , because using it with a lot of pictures ( I like the slideshow over all of my pictures) is not possible (startup will be delayed for severeal minutes)
this diff helps for me:

--- src/filelist.c.orig 2012-10-16 06:31:41.000000000 +0200
+++ src/filelist.c      2012-10-22 13:47:12.000000000 +0200
@@ -382,8 +382,7 @@
 void feh_prepare_filelist(void)
 {
        if (opt.list || opt.customlist || (opt.sort > SORT_FILENAME)
-                       || opt.preload || opt.min_width || opt.min_height
-                       || (opt.max_width != UINT_MAX) || (opt.max_height != UINT_MAX)) {
+                       || opt.preload ) {
                /* For these sort options, we have to preload images */
                filelist = feh_file_info_preload(filelist);
                if (!gib_list_length(filelist))
--- src/imlib.c.orig    2012-10-16 06:31:41.000000000 +0200
+++ src/imlib.c 2012-10-22 13:44:06.000000000 +0200
@@ -250,6 +250,15 @@

                free(tmpname);
        }
+       if (im) {
+               if ( gib_imlib_image_get_width(*im)  < opt.min_width ||
+                          gib_imlib_image_get_height(*im) < opt.min_height ) {
+                        D(("Image size does not fit %d x %d (min: %dx%d max: %dx%d",
+          gib_imlib_image_get_width(*im),gib_imlib_image_get_height(*im),
+          opt.min_width, opt.min_height, opt.max_width, opt.max_height ));
+                        err = 1;
+    }
+  }

        if ((err) || (!im)) {
                if (opt.verbose && !opt.quiet) {

helau commented Oct 22, 2012

P.S. The first diff was not working, I updated it with a better one (hopefully;)

Owner

derf commented Oct 23, 2012

I thought about this when implementing --{min,max}-dim, but decided against it because when combining it with --thumbnail, this method creates unneccessarily large thumbnail windows.

I'm not sure which usecases are more common, to me using a thumbnail window to list images in certain resolution ranges seems probable at least.

@derf derf reopened this Oct 23, 2012

helau commented Oct 23, 2012

You're right, its difficult to decide.
But when using it in slideshow without thumbnail its definitely better.
Anyway the fix works fine for me - thanks for your nice application :)

@derf derf closed this Dec 23, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment