From 821107d53c2e390240d25c036b99ebbf9b4a93b6 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 24 Dec 2015 14:40:16 +0100 Subject: [PATCH] Ignore invalid SVG images * shr.el (shr-tag-svg): Ignore SVG images that have no width or height, because these can't be displayed by ImageMagick, anyway. --- lisp/net/shr.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/net/shr.el b/lisp/net/shr.el index dbf45b885da..d51b8c73d10 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1152,7 +1152,9 @@ ones, in case fg and bg are nil." (defun shr-tag-svg (dom) (when (and (image-type-available-p 'svg) - (not shr-inhibit-images)) + (not shr-inhibit-images) + (dom-attr dom 'width) + (dom-attr dom 'height)) (funcall shr-put-image-function (list (shr-dom-to-xml dom) 'image/svg+xml) "SVG Image"))) -- 2.39.2