GNU bug report logs - #6258
create-animated-image hangs

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Mon, 24 May 2010 16:13:02 UTC

Severity: normal

Tags: patch

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6258 in the body.
You can then email your comments to 6258 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6258; Package emacs. (Mon, 24 May 2010 16:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 24 May 2010 16:13:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: bug-gnu-emacs <at> gnu.org
Subject: create-animated-image hangs
Date: Mon, 24 May 2010 19:03:21 +0300
When the delay between images in an animated GIF file is 0,
then calls for `run-with-timer' without delay hangs up.
Replacing it with `run-with-idle-timer' doesn't help.
An example of the animated GIF that hangs up is
http://en.wikipedia.org/wiki/File:Animated_glider_emblem.gif

This patch makes a short delay (0.1 sec) in this case.
Visually its speed looks the same as the speed of changing
images in Firefox when an animated GIF has no delay.

=== modified file 'lisp/image.el'
--- lisp/image.el	2010-04-02 23:28:46 +0000
+++ lisp/image.el	2010-05-24 16:01:45 +0000
@@ -684,10 +684,13 @@ (defun image-animated-p (image)
     (let* ((metadata (image-metadata image))
 	   (images (plist-get metadata 'count))
 	   (extdata (plist-get metadata 'extension-data))
-	   (anim (plist-get extdata #xF9)))
-      (and (integerp images) (> images 1)
-	   (stringp anim) (>= (length anim) 4)
-	   (cons images (+ (aref anim 1) (* (aref anim 2) 256))))))))
+	   (anim (plist-get extdata #xF9))
+	   (tmo (and (integerp images) (> images 1)
+		     (stringp anim) (>= (length anim) 4)
+		     (+ (aref anim 1) (* (aref anim 2) 256)))))
+      (when tmo
+	(if (eq tmo 0) (setq tmo 10))
+	(cons images tmo))))))
 
 
 (provide 'image)

-- 
Juri Linkov
http://www.jurta.org/emacs/




Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Tue, 25 May 2010 16:12:03 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> jurta.org>:
bug acknowledged by developer. (Tue, 25 May 2010 16:12:03 GMT) Full text and rfc822 format available.

Message #10 received at 6258-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: 6258-done <at> debbugs.gnu.org
Subject: Re: bug#6258: create-animated-image hangs
Date: Tue, 25 May 2010 18:57:45 +0300
> This patch makes a short delay (0.1 sec) in this case.

Committed and closed.

-- 
Juri Linkov
http://www.jurta.org/emacs/




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 23 Jun 2010 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 51 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.