diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-09-15 21:03:42 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-09-15 21:03:42 -0400 |
| commit | bdf98a7e91b2282e52d6a4e8e3c7344dceb24491 (patch) | |
| tree | 908ca69830efb40555eef4845844b2a9ab312a2c /lib/svg/units.py | |
| parent | 5953d54c14d9c5a46e0405c55393ff7aae71b414 (diff) | |
handle SVGs without bounding box
Diffstat (limited to 'lib/svg/units.py')
| -rw-r--r-- | lib/svg/units.py | 5 |
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 |
