GNU bug report logs -
#23431
Displaying animated GIFs can make Emacs unresponsive
Previous Next
Full log
View this message in rfc822 format
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
This bug report was last modified 9 years and 69 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.