Skip to content

Commit

Permalink
Fix missing svg attribute bug #76
Browse files Browse the repository at this point in the history
  • Loading branch information
heyzec authored and mateosss committed Jul 25, 2022
1 parent 1a05515 commit 2fe52ef
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions svg2png.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ def prettify(xml_string):
ET.register_namespace(key, value)

root = dom.getroot()
width, height = (
int_ignore_units(root.attrib["width"]),
int_ignore_units(root.attrib["height"]),
)
_, _, width, height = map(int, filter(bool, re.split(r'[ ,]', root.attrib["viewBox"])))
width_gap, height_gap = (1 - FRAC) * width / 2, (1 - FRAC) * height / 2

# Group all elements that are children of <svg> while changing their 'style' attributes
Expand Down

0 comments on commit 2fe52ef

Please sign in to comment.