From ac2a6ff04044704c8334b8e6adab6db0a4f9f80a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bert=20M=C3=BCnnich?= Date: Thu, 14 Nov 2013 17:12:55 +0100 Subject: [PATCH] Correct out-of-range gamma values given on command line --- image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image.c b/image.c index cadbe45..ee49076 100644 --- a/image.c +++ b/image.c @@ -85,7 +85,7 @@ void img_init(img_t *img, win_t *win) img->multi.animate = false; img->cmod = imlib_create_color_modifier(); - img->gamma = options->gamma; + img->gamma = MIN(MAX(options->gamma, -GAMMA_RANGE), GAMMA_RANGE); } void exif_auto_orientate(const fileinfo_t *file)