Mu4e: Fix inline LaTeX image scaling
The structure of doom-call-process's return had changed.
This commit is contained in:
parent
c9e816e995
commit
a72d533a24
1 changed files with 8 additions and 7 deletions
|
@ -38,13 +38,14 @@ clicked."
|
||||||
(defun +org-msg-img-scale-css (img-uri)
|
(defun +org-msg-img-scale-css (img-uri)
|
||||||
"For a given IMG-URI, use imagemagik to find its width."
|
"For a given IMG-URI, use imagemagik to find its width."
|
||||||
(if +org-msg-currently-exporting
|
(if +org-msg-currently-exporting
|
||||||
(list :width
|
;; TODO change to use 'file' (NB: would only work for PNG though, apparently)
|
||||||
(format "%.1fpx"
|
(let ((width-call (doom-call-process "identify" "-format" "%w"
|
||||||
(/ (string-to-number
|
(substring img-uri 7)))) ; 7=(length "file://")
|
||||||
;; TODO change to use 'file'
|
(when (= (car width-call) 0)
|
||||||
(doom-call-process "identify" "-format" "%w"
|
(list :width
|
||||||
(substring img-uri 7))) ; 7=(length "file://")
|
(format "%.1fpx"
|
||||||
(plist-get org-format-latex-options :scale))))
|
(/ (string-to-number (cdr width-call))
|
||||||
|
(plist-get org-format-latex-options :scale))))))
|
||||||
(list :style (format "transform: scale(%.3f)"
|
(list :style (format "transform: scale(%.3f)"
|
||||||
(/ 1.0 (plist-get org-format-latex-options :scale))))))
|
(/ 1.0 (plist-get org-format-latex-options :scale))))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue