[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Scaling of image previews in org-mode
From: |
John Kitchin |
Subject: |
Re: [O] Scaling of image previews in org-mode |
Date: |
Wed, 10 Aug 2016 10:44:06 -0400 |
User-agent: |
mu4e 0.9.16; emacs 25.1.50.1 |
Certainly it could be adapted to other modes, at least for showing the
images. If there was a way to parse resizing info, or set it via
variables, you could also get resized images. The key is hooking into
font-lock and detecting where images are.
The basic framework is laid out here:
http://kitchingroup.cheme.cmu.edu/blog/2016/03/21/Displaying-image-overlays-on-image-filenames-in-Emacs/
That example had imagemagick compiled in, but it could be adapted pretty
readily to use an external imagemagick..
Uwe Brauer writes:
>>>> "John" == John Kitchin <address@hidden> writes:
>
> > I use this code here:
> > https://github.com/jkitchin/scimax/blob/master/scimax-org.el#L957
>
> > to provide inline scaling in Emacs when it is not built with imagemagick.
>
> Hi
>
> Could that package or parts of it also be used in other modes?
>
> I have the problem of displaying images in latex buffers (using auctex)
>
> The only available tool I know is iimage.el, but this package does not
> allow to re-seize the displayed image. I asked about it on emacs devel
> and the answer was: «please send a patch or wait», fail enough
>
> I just attach the mail in question below in order to clarify.
>
> ,----
> |
> |
> |
> | I just learnt about iimage.el, which is now part of GNU emacs core. I
> | like it quite a lot, the only thing which I find a bit inconvenient on
> | my 12 inch Laptop is the size of the images displayed. I did not find
> | any variable in which the size of images could be changed.
> |
> |
> | The author's address does not work anymore, so I looked at the code it
> | seems that the essential part is this:
> |
> | (if arg
> | (add-text-properties (match-beginning 0) (match-end 0)
> | `(display ,(create-image file)
> | ^^^^^
> | modification-hooks
> | (iimage-modification-hook)))
> |
> |
> | Now I checked that function and its documentation says
> | ,----
> | [+]
> | |
> | | create-image is an autoloaded compiled Lisp function in ‘image.el’.
> | | (create-image FILE-OR-DATA &optional TYPE DATA-P &rest PROPS)
> | | Create an image.
> | | ....
> | | Images should not be larger than specified by ‘max-image-size’.
> | `----
> |
> |
> | However
> | ,----
> | [+]
> | | max-image-size is a variable defined in ‘C source code’.
> | | Its value is 10.0
> | `----
> |
> | So I cannot change that value easily. Anybody has an idea how to change
> | the size of the displayed images?
> |
> | thanks
> |
> | Uwe Brauer
> |
> `----
--
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