emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 6ef896c 01/12: Ignore invalid SVG images


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] emacs-25 6ef896c 01/12: Ignore invalid SVG images
Date: Fri, 25 Dec 2015 16:05:59 +0000

branch: emacs-25
commit 6ef896cc78b7caf39541a94fd89197d7a0497f9a
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    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.
    
    Backport:
    
    (cherry picked from commit 821107d53c2e390240d25c036b99ebbf9b4a93b6)
---
 lisp/net/shr.el |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index dbf45b8..d51b8c7 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")))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]