]> git.eshelyaron.com Git - emacs.git/commitdiff
Animate GIF images that don't have an explicit delay setting
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 12 Apr 2022 10:43:56 +0000 (12:43 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 12 Apr 2022 10:43:56 +0000 (12:43 +0200)
* src/image.c (gif_load): Use the default delay for GIF images
that don't explicitly state a delay.

src/image.c

index f6143f5b46e8ca5b1fc0ee3433ac2b76006d5c2a..3b3d1fc080a3b70a920cd5826a4f441c46a90fb7 100644 (file)
@@ -9208,11 +9208,11 @@ gif_load (struct frame *f, struct image *img)
            }
        }
       img->lisp_data = list2 (Qextension_data, img->lisp_data);
-      if (delay)
-       img->lisp_data
-         = Fcons (Qdelay,
-                  Fcons (make_float (delay / 100.0),
-                         img->lisp_data));
+      img->lisp_data
+       = Fcons (Qdelay,
+                /* Default GIF delay is 1/15th of a second.  */
+                Fcons (make_float (delay? delay / 100.0: 1.0 / 15),
+                       img->lisp_data));
     }
 
   if (gif->ImageCount > 1)