bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23431: 25.0.93; EWW hangs


From: Lars Ingebrigtsen
Subject: bug#23431: 25.0.93; EWW hangs
Date: Tue, 03 May 2016 20:17:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Does the following patch help?  It'll cache the metadata.

Doesn't make much difference on the test image for me.

diff --git a/lisp/image.el b/lisp/image.el
index 2ae642a..9c27664 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -698,14 +698,21 @@ image-multi-frame-p
 the number of frames (or sub-images) in the image and DELAY is the delay
 in seconds that the image specifies between each frame.  DELAY may be nil,
 in which case you might want to use `image-default-frame-delay'."
-  (when (fboundp 'image-metadata)
-    (let* ((metadata (image-metadata image))
-          (images (plist-get metadata 'count))
-          (delay (plist-get metadata 'delay)))
-      (when (and images (> images 1))
-       (and delay (or (not (numberp delay)) (< delay 0))
-            (setq delay image-default-frame-delay))
-       (cons images delay)))))
+  (or (plist-get (cdr image) :image-metadata)
+      (when (fboundp 'image-metadata)
+        (let* ((metadata (image-metadata image))
+               (images (plist-get metadata 'count))
+               (delay (plist-get metadata 'delay))
+               (result
+                (and images
+                     (> images 1)
+                     (cons images
+                           (if (or (not (numberp delay))
+                                   (< delay 0))
+                               image-default-frame-delay
+                             delay)))))
+          (plist-put (cdr image) :image-metadata result)
+          result))))
 
 (defun image-animated-p (image)
   "Like `image-multi-frame-p', but returns nil if no delay is specified."


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no






reply via email to

[Prev in Thread] Current Thread [Next in Thread]