From bdf98a7e91b2282e52d6a4e8e3c7344dceb24491 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sat, 15 Sep 2018 21:03:42 -0400 Subject: [PATCH] handle SVGs without bounding box --- lib/svg/units.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/svg/units.py b/lib/svg/units.py index c4ec82a02..0de410ab9 100644 --- a/lib/svg/units.py +++ b/lib/svg/units.py @@ -80,7 +80,10 @@ def convert_length(length): @cache def get_viewbox(svg): - return svg.get('viewBox').strip().replace(',', ' ').split() + viewbox = svg.get('viewBox') + if viewbox is None: + viewbox = "0 0 0 0" + return viewbox.strip().replace(',', ' ').split() @cache