unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6981: create-animated-image doesn't animate
@ 2010-09-03 20:40 Juri Linkov
  2010-09-06 12:42 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Juri Linkov @ 2010-09-03 20:40 UTC (permalink / raw)
  To: 6981

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

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.


[-- Attachment #2: oii.gif --]
[-- Type: image/gif, Size: 178911 bytes --]

[-- Attachment #3: Type: text/plain, Size: 47 bytes --]


I believe imagemagick could help to fix this.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6981: create-animated-image doesn't animate
  2010-09-03 20:40 bug#6981: create-animated-image doesn't animate Juri Linkov
@ 2010-09-06 12:42 ` Stefan Monnier
  2010-09-06 21:31   ` Juri Linkov
  2010-09-06 14:11 ` Jason Rumney
  2011-05-29 21:38 ` Chong Yidong
  2 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2010-09-06 12:42 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 6981

> 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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6981: create-animated-image doesn't animate
  2010-09-03 20:40 bug#6981: create-animated-image doesn't animate Juri Linkov
  2010-09-06 12:42 ` Stefan Monnier
@ 2010-09-06 14:11 ` Jason Rumney
  2010-09-06 21:32   ` Juri Linkov
  2011-05-29 21:38 ` Chong Yidong
  2 siblings, 1 reply; 6+ messages in thread
From: Jason Rumney @ 2010-09-06 14:11 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 6981

Juri Linkov <juri@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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6981: create-animated-image doesn't animate
  2010-09-06 12:42 ` Stefan Monnier
@ 2010-09-06 21:31   ` Juri Linkov
  0 siblings, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2010-09-06 21:31 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 6981

>> 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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6981: create-animated-image doesn't animate
  2010-09-06 14:11 ` Jason Rumney
@ 2010-09-06 21:32   ` Juri Linkov
  0 siblings, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2010-09-06 21:32 UTC (permalink / raw)
  To: Jason Rumney; +Cc: 6981, Joakim Verona

> 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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6981: create-animated-image doesn't animate
  2010-09-03 20:40 bug#6981: create-animated-image doesn't animate Juri Linkov
  2010-09-06 12:42 ` Stefan Monnier
  2010-09-06 14:11 ` Jason Rumney
@ 2011-05-29 21:38 ` Chong Yidong
  2 siblings, 0 replies; 6+ messages in thread
From: Chong Yidong @ 2011-05-29 21:38 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 6981

> 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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-29 21:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-03 20:40 bug#6981: create-animated-image doesn't animate Juri Linkov
2010-09-06 12:42 ` Stefan Monnier
2010-09-06 21:31   ` Juri Linkov
2010-09-06 14:11 ` Jason Rumney
2010-09-06 21:32   ` Juri Linkov
2011-05-29 21:38 ` Chong Yidong

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).