summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-09-15 21:03:42 -0400
committerLex Neva <github.com@lexneva.name>2018-09-15 21:03:42 -0400
commitbdf98a7e91b2282e52d6a4e8e3c7344dceb24491 (patch)
tree908ca69830efb40555eef4845844b2a9ab312a2c
parent5953d54c14d9c5a46e0405c55393ff7aae71b414 (diff)
handle SVGs without bounding box
-rw-r--r--lib/svg/units.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/svg/units.py b/lib/svg/units.py
index c4ec82a0..0de410ab 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