Hi Stefan,

Stefan Hagen <sh+openbsd-po...@codevoid.de> wrote:
> Hi,
> 
> I would like to add a few more thumbnail size options to nsxiv.
> On a 4k screen, the biggest thumbnail option is still too tiny.
> 
> I added thumbnail sizes up to 320px which makes the thumbnail view
> usable again (still tiny on a laptop 4k screen, but usable).
> 
> Personally, I'd go higher (to 640px), but nsxiv creates a thumbnail
> cache in .cache/nsxiv, which stores previews at max-thumbnail-size.
> 
> I think 320px is a reasonable compromise.
> 
> You can test this in a folder with images:
> $ nsxiv -tr .
> 
> Then increase the thumbnail size to max by hitting "+" a few times.
> 
> Comments/OK?
> 
> Index: graphics/nsxiv/Makefile
> ===================================================================
> RCS file: /cvs/ports/graphics/nsxiv/Makefile,v
> diff -u -p -r1.7 Makefile
> --- graphics/nsxiv/Makefile   13 Oct 2023 09:27:20 -0000      1.7
> +++ graphics/nsxiv/Makefile   23 Jan 2025 07:18:37 -0000
> @@ -1,6 +1,7 @@
>  COMMENT =    neo simple X Image Viewer
>  
>  DIST_TUPLE = github nsxiv nsxiv v32 .
> +REVISION =   0
>  
>  CATEGORIES = graphics x11
>  
> Index: graphics/nsxiv/patches/patch-config_def_h
> ===================================================================
> RCS file: graphics/nsxiv/patches/patch-config_def_h
> diff -N graphics/nsxiv/patches/patch-config_def_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ graphics/nsxiv/patches/patch-config_def_h 23 Jan 2025 07:18:37 -0000
> @@ -0,0 +1,13 @@
> +Make thumbnail view usable on higher DPI screens
> +Index: config.def.h
> +--- config.def.h.orig
> ++++ config.def.h
> +@@ -74,7 +74,7 @@ static const bool ALPHA_LAYER = false;
> + #ifdef INCLUDE_THUMBS_CONFIG
> + 
> + /* thumbnail sizes in pixels (width == height): */
> +-static const int thumb_sizes[] = { 32, 64, 96, 128, 160 };
> ++static const int thumb_sizes[] = { 32, 64, 96, 128, 160, 192, 224, 256, 320 
> };
> + 
> + /* thumbnail size at startup, index into thumb_sizes[]: */
> + static const int THUMB_SIZE = 3;

Looks good to me. I don't have a high res screen to actually compare
it (on a 1080p screen the previews are enormous if zoomed in fully
with the patched applied, but I guess that is fine too for folks
who are as blind as me :) )

> Personally, I'd go higher (to 640px), but nsxiv creates a thumbnail
> cache in .cache/nsxiv, which stores previews at max-thumbnail-size.

Yeah, there's that, looking at the man page there is no mention of
a max cache size either unfortunately.


Best Regards,

Thim Cederlund

Reply via email to