From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: proposed modification of org-display-inline-images Date: Sun, 24 Jul 2016 12:40:51 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRMSb-0002nM-0W for emacs-orgmode@gnu.org; Sun, 24 Jul 2016 12:41:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRMSX-0005Yp-AI for emacs-orgmode@gnu.org; Sun, 24 Jul 2016 12:41:00 -0400 Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]:33778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRMSX-0005Xj-54 for emacs-orgmode@gnu.org; Sun, 24 Jul 2016 12:40:57 -0400 Received: by mail-qk0-x22b.google.com with SMTP id p74so138792729qka.0 for ; Sun, 24 Jul 2016 09:40:54 -0700 (PDT) Received: from Johns-MacBook-Air.local (c-67-171-67-30.hsd1.pa.comcast.net. [67.171.67.30]) by smtp.gmail.com with ESMTPSA id c23sm12976878qtc.45.2016.07.24.09.40.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Jul 2016 09:40:52 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "Emacs-orgmode@gnu.org" I would like to propose a change to org-display-inline-images so it can rescale images even if imagemagick is not built in to emacs. There is currently no way to rescale images when they are displayed in that case AFAICS. This is particularly a problem on Windows, as we have never found a binary linked to imagemagick for that platform. I propose we define a new customizable variable called something like org-inline-image-resize-function, and a function that takes a filename and the resize options, and returns a path to a resized function (in the temporary directory). The variable isn't technically necessary, but if someone wanted to use an alternative function, it would enable it. This function would use the "convert" program from imagemagick to do the resizing. This program can be installed independently on all the platforms I think. Since this is just for display in org, I suggest that we use a syntax like: #+attr_org: :resize resize-options [[./file.png]] the resize-options could be anything here: http://www.imagemagick.org/script/command-line-processing.php#geometry It would enable things like: reduce size by 50% #+attr_org: :resize 50% set width to 300, preserving aspect ratio #+attr_org: :resize 300 set height to 200, and preserve aspect ratio #+attr_org: :resize x200 set size to 200x300 and change aspect ratio #+attr_org: :resize 200x300! Any thoughts on this proposal? -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu