From: Lars Ingebrigtsen Date: Thu, 19 Sep 2019 13:58:34 +0000 (+0200) Subject: Further fix-ups for SVG wrapping in shr X-Git-Tag: emacs-27.0.90~1543 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2d8c8950b921e6fa97c04f72253d4c5349b2d5d4;p=emacs.git Further fix-ups for SVG wrapping in shr * lisp/net/shr.el (svg--wrap-svg): Add the size to the wrapper to avoid having the SVG images shrink (bug#37159). --- diff --git a/lisp/net/shr.el b/lisp/net/shr.el index e73c7cdee1b..d8a01cbbc1b 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1188,15 +1188,15 @@ Return a string with image data." (defun svg--wrap-svg (data) "Add a default foreground colour to SVG images." - (with-temp-buffer - (insert "" - "") - (buffer-string))) + (let ((size (image-size (create-image data nil t :scaling 1) t))) + (with-temp-buffer + (insert + (format + " " + (face-foreground 'default) + (car size) (cdr size) + (base64-encode-string data t))) + (buffer-string)))) (defun shr-image-displayer (content-function) "Return a function to display an image.