From 2c566c5320c11e9844f192bfcff2d1a869471415 Mon Sep 17 00:00:00 2001 From: dwminer Date: Sun, 27 Nov 2016 02:54:15 -0500 Subject: Add -A option to force framerate on animated images --- image.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'image.c') diff --git a/image.c b/image.c index 801bbe5..dd37207 100644 --- a/image.c +++ b/image.c @@ -68,6 +68,7 @@ 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(); @@ -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++; -- cgit v1.2.3