GNU bug report logs - #6981
create-animated-image doesn't animate

Previous Next

Package: emacs;

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

Date: Fri, 3 Sep 2010 22:39:01 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

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 6981 in the body.
You can then email your comments to 6981 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#6981; Package emacs. (Fri, 03 Sep 2010 22:39:01 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. (Fri, 03 Sep 2010 22:39: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 doesn't animate
Date: Fri, 03 Sep 2010 21:40:57 +0100
[Message part 1 (text/plain, inline)]
When looking at the attached animated image closer/farther to/from the screen,
the face appears/disappears.  When looking with/without glasses, the face
appears/disappears.  But when looking at it in Emacs, nothing changes.

[oii.gif (image/gif, inline)]
[Message part 3 (text/plain, inline)]
I believe imagemagick could help to fix this.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6981; Package emacs. (Mon, 06 Sep 2010 12:41:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: 6981 <at> debbugs.gnu.org
Subject: Re: bug#6981: create-animated-image doesn't animate
Date: Mon, 06 Sep 2010 14:42:07 +0200
> When looking at the attached animated image closer/farther to/from the
> screen, the face appears/disappears.  When looking with/without
> glasses, the face appears/disappears.  But when looking at it in
> Emacs, nothing changes.

I'm not sure I understand: your image displayed in Gnus as a bunch of
lines, which (if I tilt the screen of my laptop enough) reveal a face.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6981; Package emacs. (Mon, 06 Sep 2010 14:10:03 GMT) Full text and rfc822 format available.

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

From: Jason Rumney <jasonr <at> gnu.org>
To: Juri Linkov <juri <at> jurta.org>
Cc: 6981 <at> debbugs.gnu.org
Subject: Re: bug#6981: create-animated-image doesn't animate
Date: Mon, 06 Sep 2010 22:11:22 +0800
Juri Linkov <juri <at> jurta.org> writes:

> When looking at the attached animated image closer/farther to/from the screen,
> the face appears/disappears.  When looking with/without glasses, the face
> appears/disappears.  But when looking at it in Emacs, nothing changes.

Note the following limitation mentioned in the comment in image.c:

  /* Clear the part of the screen image that are not covered by
     the image from the GIF file.  Full animated GIF support
     requires more than can be done here (see the gif89 spec,
     disposal methods).  Let's simply assume that the part
     not covered by a sub-image is in the frame's background color.  */

The following seems to show the image animation with this limitation
(the black bars of the first frame disappear rather than remaining in
the transparent background of following frames):

(setq img (create-animated-image "~/oii.gif"))
(insert-image img)
(image-animate-start img)


The last line seems to be neccesary, even though create-animated-image
starts the animation itself. Other changes to the buffer contents seem
to stop the animation so that line needs to be evaluated again.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6981; Package emacs. (Mon, 06 Sep 2010 21:35:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 6981 <at> debbugs.gnu.org
Subject: Re: bug#6981: create-animated-image doesn't animate
Date: Mon, 06 Sep 2010 22:31:42 +0100
>> When looking at the attached animated image closer/farther to/from the
>> screen, the face appears/disappears.  When looking with/without
>> glasses, the face appears/disappears.  But when looking at it in
>> Emacs, nothing changes.
>
> I'm not sure I understand: your image displayed in Gnus as a bunch of
> lines, which (if I tilt the screen of my laptop enough) reveal a face.

In addition to the optical illusion, this image also contains animation
that can be seen in image viewers/web browsers.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6981; Package emacs. (Mon, 06 Sep 2010 21:35:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> jurta.org>
To: Jason Rumney <jasonr <at> gnu.org>
Cc: 6981 <at> debbugs.gnu.org, Joakim Verona <joakim <at> verona.se>
Subject: Re: bug#6981: create-animated-image doesn't animate
Date: Mon, 06 Sep 2010 22:32:43 +0100
> Note the following limitation mentioned in the comment in image.c:
>
>   /* Clear the part of the screen image that are not covered by
>      the image from the GIF file.  Full animated GIF support
>      requires more than can be done here (see the gif89 spec,
>      disposal methods).  Let's simply assume that the part
>      not covered by a sub-image is in the frame's background color.  */

So we have two separate problems.  The first problem is this limitation.
In Gimp I see animated image frames described as "combine".  It seems
this corresponds to the disposal method 1 ("do not dispose, the graphic
is to be left in place") in http://www.w3.org/Graphics/GIF/spec-gif89a.txt
I rememeber there was a function in imagemagick that can do this.

> (setq img (create-animated-image "~/oii.gif"))
> (insert-image img)
> (image-animate-start img)
>
> The last line seems to be neccesary, even though create-animated-image
> starts the animation itself. Other changes to the buffer contents seem
> to stop the animation so that line needs to be evaluated again.

Thanks for the hint.  Since animation works (with the limitation above)
when inserted by `insert-image', but doesn't work with `image-mode',
the bug is in `image-mode'.  And indeed, removing `append' with
`image-transform-properties' in `image-toggle-display-image' like

@@ -494,10 +494,7 @@ (defun image-toggle-display-image ()
 			    (buffer-substring-no-properties (point-min) (point-max)))
 			 filename))
 	 (type (image-type file-or-data nil data-p))
-         (image0 (create-animated-image file-or-data type data-p))
-	 (image (append image0
-                        (image-transform-properties image0)
-                        ))
+         (image (create-animated-image file-or-data type data-p))
 	 (props
 	  `(display ,image
 		    intangible ,image

fixes this bug and restores animation.  This means that the Lisp object of
the created image should not be changed.

Joakim, this suggests that the function `image-transform-properties'
you recently added should nconc display properties to the end
of the image spec.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6981; Package emacs. (Sun, 29 May 2011 21:39:02 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 6981 <at> debbugs.gnu.org
Subject: Re: create-animated-image doesn't animate
Date: Sun, 29 May 2011 17:38:32 -0400
> When looking at the attached animated image closer/farther to/from the
> screen, the face appears/disappears.  When looking with/without
> glasses, the face appears/disappears.  But when looking at it in
> Emacs, nothing changes.

The introduction of image-transform-properties in August 10 broke the
animated gif code in image-mode.el.  I've committed a fix.




bug closed, send any further explanations to 6981 <at> debbugs.gnu.org and Juri Linkov <juri <at> jurta.org> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Sun, 29 May 2011 21:39:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 13 years and 360 days ago.

Previous Next


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