Andreas Leha <> 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

>> #+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 

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")

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))

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 via email to