emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: "Emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: proposed modification of org-display-inline-images
Date: Sun, 24 Jul 2016 12:40:51 -0400	[thread overview]
Message-ID: <m2a8h76lbg.fsf@Johns-MacBook-Air.local> (raw)

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

             reply	other threads:[~2016-07-24 16:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-24 16:40 John Kitchin [this message]
2016-07-25 10:18 ` proposed modification of org-display-inline-images Rasmus
2016-07-25 12:18   ` John Kitchin
2016-07-25 20:20     ` Fabrice Popineau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2a8h76lbg.fsf@Johns-MacBook-Air.local \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).