mirror of https://github.com/djcb/mu.git
* mu4e-utils.el: support showing images online also for the non-imagemagick case
This commit is contained in:
parent
0ae12f1abf
commit
6c2f3b03d2
|
@ -733,19 +733,22 @@ mu4e logs some of its internal workings to a log-buffer. See
|
|||
|
||||
(defun mu4e-display-image (imgpath &optional maxwidth)
|
||||
"Display image IMG at point; optionally specify
|
||||
MAXWIDTH. Function tries to use imagemagick if available; otherwise
|
||||
MAXWIDTH is ignored."
|
||||
(when
|
||||
(let*
|
||||
((identify (and maxwidth (executable-find mu4e-imagemagick-identify)))
|
||||
MAXWIDTH. Function tries to use imagemagick if available (ie.,
|
||||
emacs was compiled with inmagemagick support); otherwise MAXWIDTH
|
||||
is ignored."
|
||||
(let* ((have-im (boundp 'imagemagick))
|
||||
(identify (and have-im maxwidth (executable-find mu4e-imagemagick-identify)))
|
||||
(props (and identify (shell-command-to-string
|
||||
(format "%s -format '%%w' %s"
|
||||
identify (shell-quote-argument imgpath)))))
|
||||
(width (and props (string-to-number props)))
|
||||
(img
|
||||
(img (if have-im
|
||||
(if (> (or width 0) (or maxwidth 0))
|
||||
(create-image imgpath 'imagemagick nil :width maxwidth)
|
||||
(create-image imgpath 'imagemagick))))
|
||||
(create-image imgpath 'imagemagick))
|
||||
(create-image imgpath))))
|
||||
;;(message "DISPLAY: %S %S" imgpath img)
|
||||
(when img
|
||||
(newline)
|
||||
(insert-image img imgpath nil t))))
|
||||
|
||||
|
|
Loading…
Reference in New Issue