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#10747: ImageMagick does not return much metadata Date: Fri, 24 Feb 2012 02:43:32 +0200 Organization: JURTA Message-ID: <87pqdodq3v.fsf@mail.jurta.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1330046517 30166 80.91.229.3 (24 Feb 2012 01:21:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 24 Feb 2012 01:21:57 +0000 (UTC) Cc: 10747@debbugs.gnu.org, Joakim Verona To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 24 02:21:54 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S0jr8-00048Z-MC for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Feb 2012 02:21:54 +0100 Original-Received: from localhost ([::1]:35583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0jr7-0004sR-HR for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Feb 2012 20:21:53 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:56521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0jr4-0004rx-KH for bug-gnu-emacs@gnu.org; Thu, 23 Feb 2012 20:21:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0jr3-0005ot-81 for bug-gnu-emacs@gnu.org; Thu, 23 Feb 2012 20:21:50 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49510) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0jr3-0005oN-1L for bug-gnu-emacs@gnu.org; Thu, 23 Feb 2012 20:21:49 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S0jtC-0003mm-Ij for bug-gnu-emacs@gnu.org; Thu, 23 Feb 2012 20:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Feb 2012 01:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10747 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10747-submit@debbugs.gnu.org id=B10747.133004662114521 (code B ref 10747); Fri, 24 Feb 2012 01:24:02 +0000 Original-Received: (at 10747) by debbugs.gnu.org; 24 Feb 2012 01:23:41 +0000 Original-Received: from localhost ([127.0.0.1]:53131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0jsr-0003m8-Ia for submit@debbugs.gnu.org; Thu, 23 Feb 2012 20:23:41 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:37391 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0jso-0003lu-Bp; Thu, 23 Feb 2012 20:23:39 -0500 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 018CA451C81F; Thu, 23 Feb 2012 17:19:29 -0800 (PST) In-Reply-To: (Glenn Morris's message of "Mon, 06 Feb 2012 23:35:53 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:57153 Archived-At: tags 10747 patch thanks > If I repeat the experiment with (I think this is the way to prefer > ImageMagick over libgif): > > emacs -Q --eval "(setq image-type-header-regexps nil)" \ > -f imagemagick-register-types > > then the returned metadata is just: (count 44) It is possible to get the value of delay for using in animated images by `MagickGetImageDelay' as demonstrated in the trivial patch below. Good luck implementing SVG animation in 24.2 that is more complicated: http://www.w3.org/TR/SVG/animate.html and even unsupported by some browsers: http://hoffmann.bplaced.net/svgtest/index.php?in=text === modified file 'src/image.c' --- src/image.c 2012-01-25 17:54:01 +0000 +++ src/image.c 2012-02-24 00:38:12 +0000 @@ -7666,6 +7666,12 @@ Fcons (make_number (MagickGetNumberImages (ping_wand)), img->lisp_data)); + if (MagickGetImageDelay (ping_wand) > 1) + img->lisp_data = + Fcons (Qdelay, + Fcons (make_float (MagickGetImageDelay (ping_wand) / 100.0), + img->lisp_data)); + DestroyMagickWand (ping_wand); /* Now we know how many images are inside the file. If it's not a === modified file 'lisp/image.el' --- lisp/image.el 2012-01-25 19:45:29 +0000 +++ lisp/image.el 2012-02-24 00:23:08 +0000 @@ -591,7 +591,7 @@ (defmacro defimage (symbol specs &option ;;; Animated image API -(defconst image-animated-types '(gif) +(defconst image-animated-types '(gif imagemagick) "List of supported animated image types.") (defun image-animated-p (image) @@ -601,7 +601,7 @@ (defun image-animated-p (image) DELAY is the delay in second until the next sub-image shall be displayed." (cond - ((eq (plist-get (cdr image) :type) 'gif) + ((memq (plist-get (cdr image) :type) image-animated-types) (let* ((metadata (image-metadata image)) (images (plist-get metadata 'count)) (delay (plist-get metadata 'delay)))