Fix a crash with missing size in the svg files

Fix #960
This commit is contained in:
Julien Duponchelle 2017-03-27 10:41:28 +02:00
parent ac05db5d1b
commit 8d22f2930e
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -99,8 +99,8 @@ def get_size(data, default_width=0, default_height=0):
root = tree.getroot()
try:
width = _svg_convert_size(root.attrib.get("width", 0))
height = _svg_convert_size(root.attrib.get("height", 0))
width = _svg_convert_size(root.attrib.get("width", "0"))
height = _svg_convert_size(root.attrib.get("height", "0"))
except IndexError:
raise ValueError("Invalid SVG file")