summaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'image.c')
-rw-r--r--image.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/image.c b/image.c
index b9de406..6967b3d 100644
--- a/image.c
+++ b/image.c
@@ -68,14 +68,15 @@ void img_init(img_t *img, win_t *win)
img->alpha = ALPHA_LAYER;
img->multi.cap = img->multi.cnt = 0;
img->multi.animate = options->animate;
+ img->multi.framedelay = options->framerate > 0 ? 1000 / options->framerate : 0;
img->multi.length = 0;
img->cmod = imlib_create_color_modifier();
imlib_context_set_color_modifier(img->cmod);
img->gamma = MIN(MAX(options->gamma, -GAMMA_RANGE), GAMMA_RANGE);
- img->ss.on = options->slideshow > 0.0;
- img->ss.delay = options->slideshow > 0.0 ? options->slideshow : SLIDESHOW_DELAY;
+ img->ss.on = options->slideshow > 0;
+ img->ss.delay = options->slideshow > 0 ? options->slideshow : SLIDESHOW_DELAY * 10;
}
#if HAVE_LIBEXIF
@@ -263,6 +264,7 @@ bool img_load_gif(img_t *img, const fileinfo_t *file)
img->multi.cap * sizeof(img_frame_t));
}
img->multi.frames[img->multi.cnt].im = im;
+ delay = img->multi.framedelay > 0 ? img->multi.framedelay : delay;
img->multi.frames[img->multi.cnt].delay = delay > 0 ? delay : DEF_GIF_DELAY;
img->multi.length += img->multi.frames[img->multi.cnt].delay;
img->multi.cnt++;