]> code.delx.au - gnu-emacs/commitdiff
Ignore invalid SVG images
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 24 Dec 2015 13:40:16 +0000 (14:40 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 24 Dec 2015 13:40:16 +0000 (14:40 +0100)
* 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

index dbf45b885daafbf582ca372dd068df25769fc4b7..d51b8c73d109f3bdc2de03f6da213f6ddae7e335 100644 (file)
@@ -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")))