From c195392f59b0d0d8c68f566ebe9dcacc00d50a0d Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Wed, 15 Feb 2012 09:54:07 +0530 Subject: [PATCH] org-odt.el: Use imagemagick to determine image sizes * org-odt.el (org-export-odt-image-size-probe-method) (org-odt-do-image-size): Use imagemagick preferentially to determine image sizes. See http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00288.html --- lisp/org-odt.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/org-odt.el b/lisp/org-odt.el index 438ebe2ee..87484ffb8 100644 --- a/lisp/org-odt.el +++ b/lisp/org-odt.el @@ -1912,9 +1912,9 @@ ATTR is a string of other attributes of the a element." target-file)) (defvar org-export-odt-image-size-probe-method - '(emacs imagemagick force) - "Ordered list of methods by for determining size of an embedded - image.") + (append (and (executable-find "identify") '(imagemagick)) ; See Bug#10675 + '(emacs fixed)) + "Ordered list of methods for determining image sizes.") (defvar org-export-odt-default-image-sizes-alist '(("as-char" . (5 . 0.4)) @@ -1941,8 +1941,9 @@ ATTR is a string of other attributes of the a element." (pixels-to-cms (cdr size-in-pixels))))))) (case probe-method (emacs - (size-in-cms (ignore-errors (clear-image-cache) - (image-size (create-image file) 'pixels)))) + (size-in-cms (ignore-errors ; Emacs could be in batch mode + (clear-image-cache) + (image-size (create-image file) 'pixels)))) (imagemagick (size-in-cms (let ((dim (shell-command-to-string -- 2.11.4.GIT