From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: [ODT] image scaling overridden by long caption Date: Tue, 07 Feb 2012 11:04:51 +0100 Message-ID: <87vcnjhscc.fsf@med.uni-goettingen.de> References: <87aa5lwfxm.fsf@med.uni-goettingen.de> <81pqefv4r9.fsf@gmail.com> <87r4yt9x5u.fsf@med.uni-goettingen.de> <811uqljjij.fsf@gmail.com> <87ty3g6a5w.fsf@med.uni-goettingen.de> <8162fszcv7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruhvf-000091-Ke for emacs-orgmode@gnu.org; Tue, 07 Feb 2012 05:05:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RuhvP-00061t-LV for emacs-orgmode@gnu.org; Tue, 07 Feb 2012 05:05:39 -0500 Received: from plane.gmane.org ([80.91.229.3]:46587) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuhvP-00061e-DH for emacs-orgmode@gnu.org; Tue, 07 Feb 2012 05:05:23 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1RuhvL-00036Q-Mj for emacs-orgmode@gnu.org; Tue, 07 Feb 2012 11:05:19 +0100 Received: from genepi110.genepi.med.uni-goettingen.de ([134.76.140.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Feb 2012 11:05:19 +0100 Received: from andreas.leha by genepi110.genepi.med.uni-goettingen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Feb 2012 11:05:19 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Jambunathan K writes: > 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 > 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. Hi Jambunathan, thanks for digging into this not-so-straight-forward issue. And for the detailed explanation. I do indeed have imagemagick in my load path and the imagemagick-only solution works fine in the cases I tried. Thanks. - Andreas