From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#6981: create-animated-image doesn't animate Date: Mon, 06 Sep 2010 22:32:43 +0100 Organization: JURTA Message-ID: <87r5h6immc.fsf@mail.jurta.org> References: <87wrr2ld3q.fsf@mail.jurta.org> <87k4mzm06t.fsf@home.jasonrumney.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1283809220 14155 80.91.229.12 (6 Sep 2010 21:40:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Sep 2010 21:40:20 +0000 (UTC) Cc: 6981@debbugs.gnu.org, Joakim Verona To: Jason Rumney Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 06 23:40:18 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OsjQE-0007Nb-8I for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Sep 2010 23:40:14 +0200 Original-Received: from localhost ([127.0.0.1]:47114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OsjQD-00084j-K1 for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Sep 2010 17:40:13 -0400 Original-Received: from [140.186.70.92] (port=37837 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OsjQ6-00082s-CY for bug-gnu-emacs@gnu.org; Mon, 06 Sep 2010 17:40:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OsjQ5-0000yB-28 for bug-gnu-emacs@gnu.org; Mon, 06 Sep 2010 17:40:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43963) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OsjQ4-0000y5-Ug for bug-gnu-emacs@gnu.org; Mon, 06 Sep 2010 17:40:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OsjLC-00019y-La; Mon, 06 Sep 2010 17:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Sep 2010 21:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6981 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6981-submit@debbugs.gnu.org id=B6981.12838088944448 (code B ref 6981); Mon, 06 Sep 2010 21:35:02 +0000 Original-Received: (at 6981) by debbugs.gnu.org; 6 Sep 2010 21:34:54 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OsjL3-00019h-WD for submit@debbugs.gnu.org; Mon, 06 Sep 2010 17:34:54 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OsjKz-00019S-Aa for 6981@debbugs.gnu.org; Mon, 06 Sep 2010 17:34:52 -0400 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id C32366E8067; Mon, 6 Sep 2010 14:36:43 -0700 (PDT) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 54A33451C0C5; Mon, 6 Sep 2010 14:36:42 -0700 (PDT) In-Reply-To: <87k4mzm06t.fsf@home.jasonrumney.net> (Jason Rumney's message of "Mon, 06 Sep 2010 22:11:22 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 06 Sep 2010 17:35:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:40011 Archived-At: > 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.