From 2041083b611c002882ea5ad2e3341bf63b8c94b4 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 31 Oct 2021 01:37:31 +0200 Subject: [PATCH] gif load debug --- lisp/image.el | 37 ++++++++++++++++++++----------------- src/image.c | 3 +++ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/lisp/image.el b/lisp/image.el index bfcbb66c25..3ab414a4d3 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -841,10 +841,10 @@ image-animate (if (setq timer (image-animate-timer image)) (cancel-timer timer)) (plist-put (cdr image) :animate-buffer (current-buffer)) - (plist-put (cdr image) :animate-tardiness 0) + ;; (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) + ;; (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))))) @@ -873,10 +873,10 @@ image-show-frame "Show frame N of IMAGE. Frames are indexed from 0. Optional argument NOCHECK non-nil means 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 (plist-get (cdr image) - :animate-multi-frame-data))))))) + ;; (unless nocheck + ;; (if (< n 0) (setq n 0) + ;; (setq n (min n (1- (car (plist-get (cdr image) + ;; :animate-multi-frame-data))))))) (plist-put (cdr image) :index n) (force-window-update (plist-get (cdr image) :animate-buffer))) @@ -912,23 +912,26 @@ image-animate-timeout for the animation speed. A negative value means to animate in reverse." ;; We keep track of "how late" image frames arrive. We decay the ;; previous cumulative value by 10% and then add the current delay. - (plist-put (cdr image) :animate-tardiness - (+ (* (plist-get (cdr image) :animate-tardiness) 0.9) - (float-time (time-since target-time)))) + ;; (plist-put (cdr image) :animate-tardiness + ;; (+ (* (plist-get (cdr image) :animate-tardiness) 0.9) + ;; (float-time (time-since target-time)))) (when (and (buffer-live-p (plist-get (cdr image) :animate-buffer)) ;; Cumulatively delayed two seconds more than expected. - (or (< (plist-get (cdr image) :animate-tardiness) 2) - (progn - (message "Stopping animation; animation possibly too big") - nil))) + t + ;; (or (< (plist-get (cdr image) :animate-tardiness) 2) + ;; (progn + ;; (message "Stopping animation; animation possibly too big") + ;; nil)) + ) (image-show-frame image n t) (let* ((speed (image-animate-get-speed image)) (time (current-time)) (time-to-load-image (time-since time)) - (stated-delay-time - (/ (or (cdr (plist-get (cdr image) :animate-multi-frame-data)) - image-default-frame-delay) - (float (abs speed)))) + (stated-delay-time 0.07 + ;; (/ (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 diff --git a/src/image.c b/src/image.c index 2ec44584b6..b87d50d17f 100644 --- a/src/image.c +++ b/src/image.c @@ -8487,6 +8487,9 @@ gif_load (struct frame *f, struct image *img) } } + AUTO_STRING (msg, "#### gif_load=%s (%s)"); + CALLN (Fmessage, msg, make_fixnum (idx), Fimage_cache_size ()); + width = img->width = gif->SWidth; height = img->height = gif->SHeight; -- 2.30.2