I have a variable that holds a GIF image

my-image's value is
(image :type gif :data "GIF89a+

I add it to a buffer and it is being displayed

(insert-image my-image)

But the animation is not being shown. I try to do

(image-animate my-image 0 t)

but the animation does not start either. If I ask the current frame

(image-current-frame my-image)

It always return zero.

How can I start the animation?


An animated GIF is a multi-frame image to Emacs. You can display an arbitrary frame of it by specifying the :index property in the image specification. image-animate does modify the index of the given image specification with a timer.

That being said, it works for me. What you could do is finding the definition of image-animate with M-x find-function, then instrument it with C-u C-M-x and step through its execution to see what's going wrong. Alternatively, try figuring out whether something about the image spec is wrong, like by using an absolute file name as argument to create-image.

  • Thanks a lot! I didn't know about find-function. Looks like image-multi-frame-p is always returning nil as if no image was animated. I'll continue debugging. image-metadata is always returning nil too. Jan 2 '16 at 20:04
  • Probably related to this debbugs.gnu.org/cgi/bugreport.cgi?bug=21714 I was able to find it thanks to your comment so I'm marking as accepted Jan 2 '16 at 20:11
  • 1
    OSX will never animate -- I filed a bug a few months ago. Windows builds work properly when built with and contain the necessary libraries.
    – lawlist
    Jan 2 '16 at 20:11
  • I could get GIF animations working inside Emacs on Windows platform, note that you need a right compiled Emacs and some libraries.
    – ReneFroger
    Jan 3 '16 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.