emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* scale inline images in orgmode
@ 2012-08-28 20:13 AW
  2012-08-28 20:34 ` Russell Adams
  2012-08-30 13:52 ` Bastien
  0 siblings, 2 replies; 8+ messages in thread
From: AW @ 2012-08-28 20:13 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

If I include an image in an *.org file, let's say [[large-image.jpg]], I can 
toggle the inline image with C-c C-x C-v .

I would like to scale the images on screen in the buffer, often I don't need a 
large picture, but just a reminder, what's on the picture. Is there a way to 
scale the image on screen, something like #+ATTR: scale=0.5 ?

Regards,

Alexander

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: scale inline images in orgmode
  2012-08-28 20:13 scale inline images in orgmode AW
@ 2012-08-28 20:34 ` Russell Adams
  2012-08-28 21:31   ` Detlef Steuer
  2012-08-30 13:52 ` Bastien
  1 sibling, 1 reply; 8+ messages in thread
From: Russell Adams @ 2012-08-28 20:34 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, Aug 28, 2012 at 10:13:18PM +0200, AW wrote:
>
> I would like to scale the images on screen in the buffer, often I don't need a
> large picture, but just a reminder, what's on the picture. Is there a way to
> scale the image on screen, something like #+ATTR: scale=0.5 ?

Alexander,

I believe Org calls out to image.el via create-image. That doesn't
appear to do any resizing.

I read there may be compiled in Emacs support for Imagemagick, and I
have existing elisp code that shells out to resize images for display
separate from Org via Imagemagick's convert utility.

To Org devs, would it be difficult to add a wrapper around the
create-image call that only resizes if the image will exceed certain
dimensions (ie: window width or 75% of height?).

This is a feature I'd love to see.

Thanks.


------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: scale inline images in orgmode
  2012-08-28 20:34 ` Russell Adams
@ 2012-08-28 21:31   ` Detlef Steuer
  2012-08-29 11:57     ` Jeffrey Spencer
  0 siblings, 1 reply; 8+ messages in thread
From: Detlef Steuer @ 2012-08-28 21:31 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, 28 Aug 2012 15:34:59 -0500
Russell Adams <RLAdams@AdamsInfoServ.Com> wrote:

> On Tue, Aug 28, 2012 at 10:13:18PM +0200, AW wrote:
> >
> > I would like to scale the images on screen in the buffer, often I don't need a
> > large picture, but just a reminder, what's on the picture. Is there a way to
> > scale the image on screen, something like #+ATTR: scale=0.5 ?
> 
> Alexander,
> 
> I believe Org calls out to image.el via create-image. That doesn't
> appear to do any resizing.
> 
> I read there may be compiled in Emacs support for Imagemagick, and I
> have existing elisp code that shells out to resize images for display
> separate from Org via Imagemagick's convert utility.
> 
> To Org devs, would it be difficult to add a wrapper around the
> create-image call that only resizes if the image will exceed certain
> dimensions (ie: window width or 75% of height?).
> 
> This is a feature I'd love to see.


+1
Detlef

> 
> Thanks.
> 
> 
> ------------------------------------------------------------------
> Russell Adams                            RLAdams@AdamsInfoServ.com
> 
> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
> 
> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
> 
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: scale inline images in orgmode
  2012-08-28 21:31   ` Detlef Steuer
@ 2012-08-29 11:57     ` Jeffrey Spencer
  0 siblings, 0 replies; 8+ messages in thread
From: Jeffrey Spencer @ 2012-08-29 11:57 UTC (permalink / raw)
  To: Detlef Steuer; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]

+1
On Aug 29, 2012 7:31 AM, "Detlef Steuer" <detlef.steuer@gmx.de> wrote:

> On Tue, 28 Aug 2012 15:34:59 -0500
> Russell Adams <RLAdams@AdamsInfoServ.Com> wrote:
>
> > On Tue, Aug 28, 2012 at 10:13:18PM +0200, AW wrote:
> > >
> > > I would like to scale the images on screen in the buffer, often I
> don't need a
> > > large picture, but just a reminder, what's on the picture. Is there a
> way to
> > > scale the image on screen, something like #+ATTR: scale=0.5 ?
> >
> > Alexander,
> >
> > I believe Org calls out to image.el via create-image. That doesn't
> > appear to do any resizing.
> >
> > I read there may be compiled in Emacs support for Imagemagick, and I
> > have existing elisp code that shells out to resize images for display
> > separate from Org via Imagemagick's convert utility.
> >
> > To Org devs, would it be difficult to add a wrapper around the
> > create-image call that only resizes if the image will exceed certain
> > dimensions (ie: window width or 75% of height?).
> >
> > This is a feature I'd love to see.
>
>
> +1
> Detlef
>
> >
> > Thanks.
> >
> >
> > ------------------------------------------------------------------
> > Russell Adams                            RLAdams@AdamsInfoServ.com
> >
> > PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
> >
> > Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
> >
> >
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 1953 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: scale inline images in orgmode
  2012-08-28 20:13 scale inline images in orgmode AW
  2012-08-28 20:34 ` Russell Adams
@ 2012-08-30 13:52 ` Bastien
  2012-08-30 17:38   ` AW
  2013-05-25 14:10   ` Klaus-Dieter Bauer
  1 sibling, 2 replies; 8+ messages in thread
From: Bastien @ 2012-08-30 13:52 UTC (permalink / raw)
  To: AW; +Cc: emacs-orgmode

Hi Alexander,

AW <alexander.willand@t-online.de> writes:

> If I include an image in an *.org file, let's say [[large-image.jpg]], I can 
> toggle the inline image with C-c C-x C-v .

You can now (from git master) use `org-image-actual-width'.

(setq org-image-actual-width 300)
  => always resize inline images to 300 pixels

(setq org-image-actual-width '(400))
  => if there is a #+ATTR.*: width="200", resize to 200,
     otherwise resize to 400

(setq org-image-actual-width nil)
  => if there is a #+ATTR.*: width="200", resize to 200,
     otherwise don't resize

(setq org-image-actual-width t)
  => Never resize and use original width (the default)

HTH,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: scale inline images in orgmode
  2012-08-30 13:52 ` Bastien
@ 2012-08-30 17:38   ` AW
  2013-05-25 14:10   ` Klaus-Dieter Bauer
  1 sibling, 0 replies; 8+ messages in thread
From: AW @ 2012-08-30 17:38 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Am Donnerstag, 30. August 2012, 15:52:59 schrieb Bastien:
> Hi Alexander,
> 
> AW <alexander.willand@t-online.de> writes:
> > If I include an image in an *.org file, let's say [[large-image.jpg]], I
> > can toggle the inline image with C-c C-x C-v .
> 
> You can now (from git master) use `org-image-actual-width'.
> 
> (setq org-image-actual-width 300)
>   => always resize inline images to 300 pixels
> 
> (setq org-image-actual-width '(400))
>   => if there is a #+ATTR.*: width="200", resize to 200,
>      otherwise resize to 400
> 
> (setq org-image-actual-width nil)
>   => if there is a #+ATTR.*: width="200", resize to 200,
>      otherwise don't resize
> 
> (setq org-image-actual-width t)
>   => Never resize and use original width (the default)
> 
> HTH,

Hi Bastien,

indeed, that helps a lot! Thank you very much. 

Kind regards,
Alexander

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: scale inline images in orgmode
  2012-08-30 13:52 ` Bastien
  2012-08-30 17:38   ` AW
@ 2013-05-25 14:10   ` Klaus-Dieter Bauer
  1 sibling, 0 replies; 8+ messages in thread
From: Klaus-Dieter Bauer @ 2013-05-25 14:10 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg <at> altern.org> writes:

> 
> Hi Alexander,
> 
> AW <alexander.willand <at> t-online.de> writes:
> 
> > If I include an image in an *.org file, let's say [[large-image.jpg]], I 
can 
> > toggle the inline image with C-c C-x C-v .
> 
> You can now (from git master) use `org-image-actual-width'.
> 
> (setq org-image-actual-width 300)
>   => always resize inline images to 300 pixels
> 
> (setq org-image-actual-width '(400))
>   => if there is a #+ATTR.*: width="200", resize to 200,
>      otherwise resize to 400
> 
> (setq org-image-actual-width nil)
>   => if there is a #+ATTR.*: width="200", resize to 200,
>      otherwise don't resize
> 
> (setq org-image-actual-width t)
>   => Never resize and use original width (the default)
> 
> HTH,
> 

Hello!

I am searching for a while now for a solution to get image scaling inside 
the org-mode buffer working /on Windows/. After installing GnuWin32 at least 
displaying the various image types works, but scaling does not. 

I assume the problem simply is missing ImageMagick-support in the Windows 
binaries. Any idea, how to get it? Or how to check whether emacs was 
compiled with ImageMagick support and just can't find DLLs on my system?

Note: I am also trying a while now to get emacs compiling from source, but 
there are so many problems popping up, that I barely see a chance to get 
this working.

I am using
  org-mode 8.0.3-15-g030e96-elpa 
  GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-17 on MARVIN
  Windows 7 Home Premium, 64bit 

kind regards, Klaus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: scale inline images in orgmode
@ 2015-02-24 14:23 Shavkat Rustamov
  0 siblings, 0 replies; 8+ messages in thread
From: Shavkat Rustamov @ 2015-02-24 14:23 UTC (permalink / raw)
  To: bzg; +Cc: Org-mode

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

Hello,

This setting works fine:

(setq org-image-actual-width 300)

  => always resize inline images to 300 pixels

However, this does not {it falls back to 400 and ignores #+ATTR}:

(setq org-image-actual-width '(400))

  => if there is a #+ATTR.*: width="200", resize to 200,
     otherwise resize to 400

I tried different versions of #+ATTR, including:

##+ATTR.*: :width 150px
##+ATTR.*: width="100"
##+ATTR_HTML: :width 300px
#+ATTR_HTML: :width="100"

Any idea what’s wrong?

[-- Attachment #2: Type: text/html, Size: 648 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-02-24 14:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-28 20:13 scale inline images in orgmode AW
2012-08-28 20:34 ` Russell Adams
2012-08-28 21:31   ` Detlef Steuer
2012-08-29 11:57     ` Jeffrey Spencer
2012-08-30 13:52 ` Bastien
2012-08-30 17:38   ` AW
2013-05-25 14:10   ` Klaus-Dieter Bauer
2015-02-24 14:23 Shavkat Rustamov

Code repositories for project(s) associated with this 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).