unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: 23431@debbugs.gnu.org
Subject: bug#23431: 25.0.93; EWW hangs
Date: Tue, 03 May 2016 20:17:06 +0200	[thread overview]
Message-ID: <87h9ef2ehp.fsf@gnus.org> (raw)
In-Reply-To: <87bn4nx1iq.wl-jch@pps.univ-paris-diderot.fr>

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







  parent reply	other threads:[~2016-05-03 18:17 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03  3:29 bug#23431: 25.0.93; EWW hangs Juliusz Chroboczek
2016-05-03 14:25 ` Kaushal Modi
2016-05-03 14:26 ` Lars Ingebrigtsen
2016-05-03 15:57   ` Lars Ingebrigtsen
2016-05-03 16:20     ` Eli Zaretskii
2016-05-03 16:26       ` Lars Ingebrigtsen
2016-05-03 16:40         ` Eli Zaretskii
2016-05-03 17:04           ` Lars Ingebrigtsen
2016-05-03 17:13             ` Eli Zaretskii
2016-05-03 17:23               ` Lars Ingebrigtsen
2016-05-03 17:34                 ` Eli Zaretskii
2016-05-03 17:37                   ` Lars Ingebrigtsen
2016-05-03 17:39                   ` Lars Ingebrigtsen
2016-05-03 17:41                     ` Eli Zaretskii
2016-05-03 17:48                       ` Lars Ingebrigtsen
2016-05-03 18:17                       ` Lars Ingebrigtsen [this message]
2016-05-03 17:17             ` Eli Zaretskii
2016-05-03 17:24               ` Lars Ingebrigtsen
2016-05-03 17:40                 ` Eli Zaretskii
2016-05-03 17:43                   ` Eli Zaretskii
2016-05-03 17:47                   ` Lars Ingebrigtsen
2016-05-03 18:17                     ` Lars Ingebrigtsen
2016-05-03 18:33                       ` Eli Zaretskii
2016-05-03 16:26     ` Juliusz Chroboczek
2016-05-03 16:27       ` Lars Ingebrigtsen
2016-05-03 16:57       ` Eli Zaretskii
2016-05-03 18:51     ` Glenn Morris
2016-05-03 19:05       ` Lars Ingebrigtsen
2016-05-03 19:16         ` Glenn Morris
2016-05-03 19:23           ` Lars Ingebrigtsen
2016-05-03 20:10             ` Juliusz Chroboczek
2016-05-03 19:31         ` Eli Zaretskii
2016-05-03 19:37           ` Lars Ingebrigtsen
2016-05-04  2:34             ` Eli Zaretskii
2016-05-04 15:07               ` Lars Ingebrigtsen
2016-05-04 15:24                 ` Eli Zaretskii
2016-05-03 20:25           ` Lars Ingebrigtsen
2016-05-03 20:47             ` Lars Ingebrigtsen
2016-05-03 20:53               ` Lars Ingebrigtsen
2016-05-03 21:34                 ` Andreas Schwab
2016-05-03 23:37                 ` Lars Ingebrigtsen
2016-05-04  2:45                   ` Eli Zaretskii
2016-05-04  2:57                     ` Juliusz Chroboczek
2016-05-04 14:56                       ` Eli Zaretskii
2016-05-04 15:13                         ` Nicolas Richard
2016-05-04 15:28                           ` Eli Zaretskii
2016-05-04 15:26                         ` Juliusz Chroboczek
2016-05-04 15:55                           ` Eli Zaretskii
2016-05-04 15:10                       ` Lars Ingebrigtsen
2016-05-04 15:16                         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h9ef2ehp.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=23431@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).