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: Mon, 15 Jul 2013 12:51:24 +0200 Organization: EUR Message-ID: <87ppuk6qqb.fsf@gmail.com> References: <87a9lp8uxk.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1373885582 2631 80.91.229.3 (15 Jul 2013 10:53:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Jul 2013 10:53:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 15 12:53:04 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 1UygOu-0006Tr-ER for ged-emacs-devel@m.gmane.org; Mon, 15 Jul 2013 12:53:04 +0200 Original-Received: from localhost ([::1]:59317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UygOt-0007RZ-SQ for ged-emacs-devel@m.gmane.org; Mon, 15 Jul 2013 06:53:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UygNT-00055Y-W7 for emacs-devel@gnu.org; Mon, 15 Jul 2013 06:51:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UygNQ-0002P5-Pk for emacs-devel@gnu.org; Mon, 15 Jul 2013 06:51:35 -0400 Original-Received: from mail-ea0-x229.google.com ([2a00:1450:4013:c01::229]:33243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UygNN-0002OE-F5; Mon, 15 Jul 2013 06:51:29 -0400 Original-Received: by mail-ea0-f169.google.com with SMTP id h15so7706635eak.0 for ; Mon, 15 Jul 2013 03:51:28 -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=BSxVt+d0uq8Pb8yHI6XrwzhYGHhZv8H30AplJxor+iA=; b=Lj5UBrdg24OoM1s1wDFEpEqGd2ooU+/mE0xHAwZBtrvxQLW4qyMd9KIwUZzRPEhsM0 Xg1zqYl/05O1iFs9wjRUSn9XZcooS9eiKQ+ellSw38Apr8aIVbnAQhdqFj/9jBXyX5ZW 5RnxsjASXIEt9X/q4cDETM69Y/qHl84en2cHrGuHnfzZ/TrBNgPL5pLLBNHeFErr5xso hDYuAHo/Vk+l+cWS0ghnr3eqyhr52615OxxqVXtI5f10umvtzDUpHuqans7EetYHGCVX wgtMdKyjEX0xztCJO5nbL54ejdh4Ivusm6Ifvwx35iCQVUMLuff/T0Szt+oUFMRt8/Rk B33A== X-Received: by 10.15.108.142 with SMTP id cd14mr45103833eeb.125.1373885486642; Mon, 15 Jul 2013 03:51:26 -0700 (PDT) Original-Received: from localhost (dhcp-077-249-018-128.chello.nl. [77.249.18.128]) by mx.google.com with ESMTPSA id n45sm101712349eew.1.2013.07.15.03.51.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 15 Jul 2013 03:51:25 -0700 (PDT) In-Reply-To: (joakim@verona.se's message of "Sun, 14 Jul 2013 21:17:21 +0200") 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:161900 Archived-At: I am wiling to propose a series of patches to image.el and image-mode.el in order to implement scaling, transform functionality and auto-fit to image window. From what I see it will be quite an extensive change. So I ask before doing anything. First of all there is no image universal api for transforms. The functions image-transform-XXX in image-mode are very image-mode specific and all operate by side effects and rely on (many) global variables and image-toggle-display-image function (the core of image-mode). 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. The api could be pushed further by implementing a generic transform map, and then make all image modes to use it for images at point. Of course all the above will work only with imagemagick support. Vitalie >> joakim@verona.se >> on Sun, 14 Jul 2013 21:17:21 +0200 wrote: > Glenn Morris writes: >> joakim@verona.se wrote: >> >>>> Is there a hidden reason why image scaling is not yet implemented? >>>> >>>> ;; Not yet implemented. >>>> ;; (defvar image-transform-minor-mode-map >>>> ;; (let ((map (make-sparse-keymap))) >>>> ;; ;; (define-key map [(control ?+)] 'image-scale-in) >>>> ;; ;; (define-key map [(control ?-)] 'image-scale-out) >>>> ;; ;; (define-key map [(control ?=)] 'image-scale-none) >>>> ;; ;; (define-key map "c f h" 'image-scale-fit-height) >>>> ;; ;; (define-key map "c ]" 'image-rotate-right) >>>> ;; map) >>>> ;; "Minor mode keymap `image-transform-mode'.") >>>> >>> >>> I worked on scaling support for image mode when I worked on the >>> original ImageMagik patch. However, I didnt have time to finish the >>> support. The above keymap was probably written by someone else, have a >>> look in the log. >> >> No, you wrote it. > Interesting. >> http://lists.gnu.org/archive/html/emacs-diffs/2010-08/msg00213.html> >> It's a shame this stuff was never finished. Do you have time to do it >> now? > Not really, but I can try uncommenting that code and see what > happens. Perhaps I even wrote some notes for myself somewhere...