Browse Source

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
Jambunathan K 13 years ago
parent
commit
c195392f59
1 changed files with 6 additions and 5 deletions
  1. 6 5
      lisp/org-odt.el

+ 6 - 5
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