[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6981: create-animated-image doesn't animate
From: |
Juri Linkov |
Subject: |
bug#6981: create-animated-image doesn't animate |
Date: |
Mon, 06 Sep 2010 22:32:43 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) |
> 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.