summaryrefslogtreecommitdiff
path: root/src/image.c
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-04-12 14:45:13 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-04-12 14:45:29 +0200
commit7b67b9a5a2135d479dfe86f40109778ac5f99920 (patch)
tree33ab241b7145a99edfef72c7f418d8617fa012a9 /src/image.c
parent9561d45de16b1dece79410c126ff741c09d91e22 (diff)
downloademacs-7b67b9a5a2135d479dfe86f40109778ac5f99920.tar.gz
Store less data in the gif animation cache
* src/image.c (gif_load): Only start a cache if we're have an :index entry (which means that we're trying to animate something).
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/image.c b/src/image.c
index f56d02bf198..b6edcf96a0b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8814,14 +8814,12 @@ gif_load (struct frame *f, struct image *img)
EMACS_INT idx = -1;
int gif_err;
struct anim_cache* cache = NULL;
-
/* Which sub-image are we to display? */
- {
- Lisp_Object image_number = image_spec_value (img->spec, QCindex, NULL);
- idx = FIXNUMP (image_number) ? XFIXNAT (image_number) : 0;
- }
+ Lisp_Object image_number = image_spec_value (img->spec, QCindex, NULL);
+
+ idx = FIXNUMP (image_number) ? XFIXNAT (image_number) : 0;
- if (idx != -1)
+ if (!NILP (image_number))
{
/* If this is an animated image, create a cache for it. */
cache = anim_get_animation_cache (img->spec);