Commit 68373bb7 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Merge branch 'ulteq-cache-size-option'

parents 51ed4f02 91b331f0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -205,6 +205,16 @@ Zoom pictures to screen size in fullscreen / fixed geometry mode.
.
Create borderless windows.
.
.It Cm --cache-size Ar size
.
Set Imlib2 in-memory cache to
.Ar size
MiB. A higher cache size can
significantly improve performance especially for small slide shows, however at
the cost of increased memory consumption.
.Ar size
must be between 0 and 2048 MiB and defaults to 4.
.
.It Cm -P , --cache-thumbnails
.
Enable thumbnail caching in
+1 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ OPTIONS
     --min-dimension WxH   Only show images with width >= W and height >= H
     --max-dimension WxH   Only show images with width <= W and height <= H
     --scroll-step COUNT   scroll COUNT pixels when movement key is pressed
     --cache-size NUM      imlib cache size in mebibytes (0 .. 2048)

MONTAGE MODE OPTIONS
 -X, --ignore-aspect       Set thumbnail to specified width/height without
+12 −0
Original line number Diff line number Diff line
@@ -131,6 +131,8 @@ void init_x_and_imlib(void)
	imlib_context_set_operation(IMLIB_OP_COPY);
	wmDeleteWindow = XInternAtom(disp, "WM_DELETE_WINDOW", False);

	imlib_set_cache_size(opt.cache_size * 1024 * 1024);

	/* Initialise random numbers */
	srand(getpid() * time(NULL) % ((unsigned int) -1));

@@ -254,6 +256,16 @@ int feh_load_image(Imlib_Image * im, feh_file * file)
		return(0);
	}

	/*
	 * By default, Imlib2 unconditionally loads a cached file without checking
	 * if it was modified on disk. However, feh (or rather its users) should
	 * expect image changes to appear at the next reload. So we tell Imlib2 to
	 * always check the file modification time and only use a cached image if
	 * the mtime was not changed. The performance penalty is usually negligible.
	 */
	imlib_context_set_image(*im);
	imlib_image_set_changes_on_disk();

#ifdef HAVE_LIBEXIF
	int orientation = 0;
	ExifData *exifData = exif_data_new_from_file(file->filename);
+10 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ void init_parse_options(int argc, char **argv)
	opt.jump_on_resort = 1;

	opt.screen_clip = 1;
	opt.cache_size = 4;
#ifdef HAVE_LIBXINERAMA
	/* if we're using xinerama, then enable it by default */
	opt.xinerama = 1;
@@ -410,6 +411,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
		{"xinerama-index", 1, 0, 239},
		{"insecure"      , 0, 0, 240},
		{"no-recursive"  , 0, 0, 241},
		{"cache-size"    , 1, 0, 243},
		{0, 0, 0, 0}
	};
	int optch = 0, cmdx = 0;
@@ -772,6 +774,14 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
			break;
		case 241:
			opt.recursive = 0;
			break;
		case 243:
			opt.cache_size = atoi(optarg);
			if (opt.cache_size < 0)
				opt.cache_size = 0;
			if (opt.cache_size > 2048)
				opt.cache_size = 2048;
			break;
		default:
			break;
		}
+3 −0
Original line number Diff line number Diff line
@@ -117,6 +117,9 @@ struct __fehoptions {
	/* signed in case someone wants to invert scrolling real quick */
	int scroll_step;

	// imlib cache size in mebibytes
	int cache_size;

	unsigned int min_width, min_height, max_width, max_height;

	unsigned char mode;