emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Andreas Leha <andreas.leha@med.uni-goettingen.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: [ODT] image scaling overridden by long caption
Date: Tue, 31 Jan 2012 10:29:08 +0530	[thread overview]
Message-ID: <8162fszcv7.fsf@gmail.com> (raw)
In-Reply-To: <87ty3g6a5w.fsf@med.uni-goettingen.de> (Andreas Leha's message of "Fri, 27 Jan 2012 23:41:15 +0100")

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:


>>> #+label: fig:baz
>>> #+name: baz
>>> #+attr_odt: :scale 0.5
>>> #+header: :file baz.png
>>> #+header: :width 7200 :height 3600 :res 600
>>> #+begin_src R :exports results :results graphics
>>>   plot(1:10, 1:10)
>>> #+end_src

Image that R outputs is 7200-by-3600.

>> #+begin_src emacs-lisp
>>   (list (* max-image-size (frame-pixel-width)) 
>>         (* max-image-size (frame-pixel-height)))
>> #+end_src
>
> #+results:
> | 3648.0 | 4320.0 |

Emacs will "refuse to load" images that cannot fit in 3640-by-4320
area. Note that max-image dimensions is "tightly coupled" with the frame
size.

>> #+begin_src emacs-lisp
>>     (message "%S" (ignore-errors 
>>                     (image-size (create-image "baz.png") 'pixels)))
>> #+end_src
>
> #+results:
> : (30 . 30)

Instead of loading a large image, Emacs tries to create a "safe"
30-by-30 pixel area (whatver it is).

The solution is to instruct Emacs to handle higher image sizes. Just
bump the value of max-image-size. For example, add this to init file.

#+begin_src emacs-lisp
  (setq max-image-size (* 2 max-image-size)) ;; modify scale 
#+end_src

Side note:
==========

If you have imagemagick on your machine(s) and "identify" program is in
your load path,

#+begin_src emacs-lisp
  (executable-find "identify")
#+end_src

you can configure ODT export to use imagemagick as primary source for
 probing image dimensions. This you can do by adding the following to
 your .emacs.

#+begin_src emacs-lisp
  (setq org-export-odt-image-size-probe-method '(imagemagick force))
#+end_src

Ps: If you happen to try out imagemagick-only setting, let me know if
you run in to any issues. You will be the first person (that I know of)
to try it out.
-- 

  reply	other threads:[~2012-01-31  4:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18  8:52 [ODT] image scaling overridden by long caption Andreas Leha
2012-01-19 20:03 ` Jambunathan K
2012-01-21 10:18   ` Andreas Leha
2012-01-23 19:53     ` Jambunathan K
2012-01-23 21:20       ` Nicolas Goaziou
2012-02-01  9:16         ` comments and attributes Jambunathan K
2012-02-01 13:04           ` Nicolas Goaziou
2012-02-15  0:03       ` [ODT] image scaling overridden by long caption Andreas Leha
2012-01-27 14:40     ` Jambunathan K
2012-01-27 22:41       ` Andreas Leha
2012-01-31  4:59         ` Jambunathan K [this message]
2012-02-07 10:04           ` Andreas Leha
2012-01-23  1:53   ` Side-by-side support (was:Re: [ODT] image scaling overridden by long caption) Christian Wittern
2012-01-23 16:34     ` Side-by-side support Jambunathan K
2012-01-23 23:51       ` Christian Wittern

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=8162fszcv7.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=andreas.leha@med.uni-goettingen.de \
    --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).