branch: externals/org
commit 7310c05791001dd1f283721a448431b4b8e86610
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    ox-odt: Ignore stderr when determining image size
    
    * lisp/ox-odt.el (org-odt--image-size): Do not try to parse error from
    identity program.  Sometimes it can emit warnings that may happen to
    match the regexp we use to determine image size.
---
 lisp/ox-odt.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 389cd7e4ca..4f6fac1cb6 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -2232,9 +2232,10 @@ SHORT-CAPTION are strings."
            ;; Use Imagemagick.
            (and (executable-find "identify")
                 (let ((size-in-pixels
-                       (let ((dim (shell-command-to-string
-                                   (format "identify -format \"%%w:%%h\" 
\"%s\""
-                                           file))))
+                       (let ((dim (with-temp-buffer
+                                     (call-process "identify" nil 
`(,(current-buffer) nil) nil
+                                                   "-format" "%w:%h" (format 
"%s" file))
+                                     (buffer-string))))
                          (when (string-match "\\([0-9]+\\):\\([0-9]+\\)" dim)
                            (cons (string-to-number (match-string 1 dim))
                                  (string-to-number (match-string 2 dim)))))))

Reply via email to