From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.devel Subject: Re: imagemagic in image-mode and image-dired-thumbnail-mode? Date: Wed, 17 Jul 2013 09:29:12 +0200 Organization: EUR Message-ID: <87vc49y793.fsf@gmail.com> References: <87a9lp8uxk.fsf@gmail.com> <87ppuk6qqb.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1374046164 9616 80.91.229.3 (17 Jul 2013 07:29:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Jul 2013 07:29:24 +0000 (UTC) Cc: joakim@verona.se, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 17 09:29:24 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UzMAt-0007Ck-Jg for ged-emacs-devel@m.gmane.org; Wed, 17 Jul 2013 09:29:23 +0200 Original-Received: from localhost ([::1]:44116 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzMAt-0000cj-7v for ged-emacs-devel@m.gmane.org; Wed, 17 Jul 2013 03:29:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzMAo-0000ce-De for emacs-devel@gnu.org; Wed, 17 Jul 2013 03:29:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzMAl-0000sN-JI for emacs-devel@gnu.org; Wed, 17 Jul 2013 03:29:18 -0400 Original-Received: from mail-ea0-x229.google.com ([2a00:1450:4013:c01::229]:50504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzMAl-0000sI-Cq for emacs-devel@gnu.org; Wed, 17 Jul 2013 03:29:15 -0400 Original-Received: by mail-ea0-f169.google.com with SMTP id h15so855354eak.28 for ; Wed, 17 Jul 2013 00:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=3upzuT3YjXwaG0KYWJq0glviFIiLv1RseUDr1C4jRZo=; b=P5HAO2DjiB5j+BcDMziU7Dih5gq8E6GSBJRrW+fAKqFivtZyLYw9ZWKwcgUUICdhOQ 008FHu3D+U7SocFUkyB5S/7X2uNVYSyLVNDNpuosKe6KJXrFg1FWed7WSP8gI/xI0Iig gpkL1qS9rz40HOYjObPTGfEz1yuRVU7itebJs4kUq2Rehha6KtV+uzC1+LkZ+3wx6M7k 6FbZ+GC3e95225v0uqk9sSpw8aFw2gwZAznbQV6DMbYoI/oYPmWy0PfJfOHvKi6r0yMT uYWEZdQ4uKEDnV1giLcORq0+niAcn147P2hegasTWR96xnp4FjRT+6KqAJyRhaYu1BY5 Nmyw== X-Received: by 10.14.173.70 with SMTP id u46mr4976495eel.92.1374046153952; Wed, 17 Jul 2013 00:29:13 -0700 (PDT) Original-Received: from localhost (dhcp-077-249-018-128.chello.nl. [77.249.18.128]) by mx.google.com with ESMTPSA id r54sm8541972eev.8.2013.07.17.00.29.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 17 Jul 2013 00:29:13 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Tue, 16 Jul 2013 17:26:45 -0400") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:161964 Archived-At: >> Stefan Monnier >> on Tue, 16 Jul 2013 17:26:45 -0400 wrote: >> So the proposal is to rewrite all those transform functions into a >> consistent image transform api and move them into image.el. Then add >> interactive transformation commands to image-mode.el, iimage.el, >> image-dired.el, gnus etc that will rely on those. > That sounds good. >> Of course all the above will work only with imagemagick support. > Actually, I wonder if it can't be made to work for non-imagemagick > images: by operating on image-specs, it should be possible to make the > code do things like "extract the filename, pass the file to `convert' > and create a new image-spec for that temp file", while on imagemagick > images it would just fiddle with the paramters like :height. Yes, this is how image-dired-thumbnail-mode works. It comes to bookkeeping original file metadata which could be done in the image data structure itself. The transform api and manipulation UI is almost finished. I will post it later today. What I am doing right now is converting the image to imagemagick type whenever user requests a transformation of any sort. This works very well with the drawback that the image is loaded twice once as original type and then as imagemagick. I don't feel any difference in speed of conversion though. To avoid this, I have create-image-prefer-type which can take 'imagemagick or nil. In the future it can be extended to other back-ends, if any. This variable takes effect only when create-image is called with no explicit TYPE argument. Is this a right approach? Vitalie