Commit 3cc2c50b authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

major --thumbnails speed impromevents, new --thumb-redraw option

See ChangeLog / man/feh.1 "--thumb-redraw" for more
parent d37ff6f9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4,6 +4,11 @@ git HEAD
    * Fix blur mode (Ctrl + left mouse key)
    * Center images in index/thumbnail mode relative to the text below them
    * Support caching of "large" (up to 256x256 pixels) thumbnails
    * New --thumb-redraw option as workaround to speed up thumbnail mode
      (thumbnail mode redrawing is quite slow, so now a redraw only happens
      every 10 thumbnails by default - can be changed with this option)
    * Because of that: Major speed improvements for --thumbnails, especially
      with cached thumbnails

Thu May  6 08:34:39 CEST 2010  Daniel Friesel <derf@chaosdorf.de>

+18 −0
Original line number Diff line number Diff line
@@ -443,6 +443,24 @@ is specified.
Set thumbnail height.
.It Cm -y , --thumb-width Ar pixels
Set thumbnail width.
.It Cm --thumb-redraw Ar n
Only relevant for
.Cm --thumbnails :
Redraw thumbnail window every
.Ar n
images.  In
.Nm
<= 1.5, the thumbnail image used to be redrawn after every computed thumbnail
.Pq so, it updated immediately .
However, since the redrawing takes quite long
.Pq especially for thumbnail mode on a large filelist ,
this turned out to be a major performance penalty.
As a workaround, the thumbnail image is redrawn every 10th image now by
default. Set
.Ar n No = 1
to get the old behaviour,
.Ar n No = 0
will only redraw once all thumbnails are loaded.
.El
.
.Sh INDEX MODE OPTIONS
+6 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ void init_parse_options(int argc, char **argv)
	opt.slideshow_delay = -1.0;
	opt.thumb_w = 60;
	opt.thumb_h = 60;
	opt.thumb_redraw = 10;
	opt.menu_font = estrdup(DEFAULT_MENU_FONT);
	opt.font = estrdup(DEFAULT_FONT);
	opt.image_bg = estrdup("default");
@@ -395,6 +396,7 @@ static void feh_parse_option_array(int argc, char **argv)
		{"index-name", 1, 0, 230},
		{"index-size", 1, 0, 231},
		{"index-dim", 1, 0, 232},
		{"thumb-redraw", 1, 0, 233},
		{0, 0, 0, 0}
	};
	int optch = 0, cmdx = 0;
@@ -738,6 +740,9 @@ static void feh_parse_option_array(int argc, char **argv)
		case 232:
			opt.index_show_dim = atoi(optarg);
			break;
		case 233:
			opt.thumb_redraw = atoi(optarg);
			break;
		default:
			break;
		}
@@ -963,6 +968,7 @@ void show_usage(void)
"                           a new viewing window\n"
"     --cache-thumbnails    Enable thumbnail caching for thumbnail mode.\n"
"                           Only works with thumbnails <= 256x256 pixels\n"
"     --thumb-redraw N      Redraw thumbnail window every N images\n"
" -~, --thumb-title STRING  Set window title for images opened from thumbnail mode.\n"
"                           Supports format specifiers, see there.\n"
" -I, --fullindex           Same as index mode, but below each thumbnail you\n"
+1 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ struct __fehoptions {
	int thumb_h;
	int limit_w;
	int limit_h;
	unsigned int thumb_redraw;
	int reload;
	int sort;
	int debug_level;
+10 −1
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ void init_thumbnail_mode(void)
	int index_image_width, index_image_height;
	int x_offset_name = 0, x_offset_dim = 0, x_offset_size = 0;
	char *s;
	unsigned int thumb_counter = 0;

	/* initialize thumbnail mode data */
	td.im_main = NULL;
@@ -350,11 +351,19 @@ void init_thumbnail_mode(void)
			last = l;
		}
		if (opt.display) {
			/* thumb_counter is unsigned, so no need to catch overflows */
			if (++thumb_counter == opt.thumb_redraw) {
				winwidget_render_image(winwid, 0, 0);
				thumb_counter = 0;
			}
			if (!feh_main_iteration(0))
				exit(0);
		}
	}

	if (thumb_counter != 0)
		winwidget_render_image(winwid, 0, 0);

	if (opt.verbose)
		fprintf(stdout, "\n");