forked from mirrors/org-mode
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
This commit is contained in:
parent
4657454381
commit
c195392f59
|
@ -1912,9 +1912,9 @@ ATTR is a string of other attributes of the a element."
|
||||||
target-file))
|
target-file))
|
||||||
|
|
||||||
(defvar org-export-odt-image-size-probe-method
|
(defvar org-export-odt-image-size-probe-method
|
||||||
'(emacs imagemagick force)
|
(append (and (executable-find "identify") '(imagemagick)) ; See Bug#10675
|
||||||
"Ordered list of methods by for determining size of an embedded
|
'(emacs fixed))
|
||||||
image.")
|
"Ordered list of methods for determining image sizes.")
|
||||||
|
|
||||||
(defvar org-export-odt-default-image-sizes-alist
|
(defvar org-export-odt-default-image-sizes-alist
|
||||||
'(("as-char" . (5 . 0.4))
|
'(("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)))))))
|
(pixels-to-cms (cdr size-in-pixels)))))))
|
||||||
(case probe-method
|
(case probe-method
|
||||||
(emacs
|
(emacs
|
||||||
(size-in-cms (ignore-errors (clear-image-cache)
|
(size-in-cms (ignore-errors ; Emacs could be in batch mode
|
||||||
(image-size (create-image file) 'pixels))))
|
(clear-image-cache)
|
||||||
|
(image-size (create-image file) 'pixels))))
|
||||||
(imagemagick
|
(imagemagick
|
||||||
(size-in-cms
|
(size-in-cms
|
||||||
(let ((dim (shell-command-to-string
|
(let ((dim (shell-command-to-string
|
||||||
|
|
Loading…
Reference in New Issue