(cancel-timer timer))
(plist-put (cdr image) :animate-buffer (current-buffer))
(plist-put (cdr image) :animate-tardiness 0)
+ ;; Stash the data about the animation here so that we don't
+ ;; trigger image recomputation unnecessarily later.
+ (plist-put (cdr image) :animate-multi-frame-data animation)
(run-with-timer 0.2 nil #'image-animate-timeout
image (or index 0) (car animation)
0 limit (+ (float-time) 0.2)))))
do not check N is within the range of frames present in the image."
(unless nocheck
(if (< n 0) (setq n 0)
- (setq n (min n (1- (car (image-multi-frame-p image)))))))
+ (setq n (min n (1- (car (plist-get (cdr image)
+ :animate-multi-frame-data)))))))
(plist-put (cdr image) :index n)
(force-window-update))
(image-show-frame image n t)
(let* ((speed (image-animate-get-speed image))
(time (current-time))
- (animation (image-multi-frame-p image))
(time-to-load-image (time-since time))
- (stated-delay-time (/ (or (cdr animation)
- image-default-frame-delay)
- (float (abs speed))))
+ (stated-delay-time
+ (/ (or (cdr (plist-get (cdr image) :animate-multi-frame-data))
+ image-default-frame-delay)
+ (float (abs speed))))
;; Subtract off the time we took to load the image from the
;; stated delay time.
(delay (max (float-time (time-subtract stated-delay-time