Many SVG files have width and height attributes set on the root element, or a related viewBox attribute. SVGs embedded in HTML documents also usually have their dimensions specified there. I think you should default to any of these.
Currently, imageSize is first set to 100, but later falls back to 256 if the user input cannot be parsed.
Many SVG files have
width
andheight
attributes set on the root element, or a relatedviewBox
attribute. SVGs embedded in HTML documents also usually have their dimensions specified there. I think you should default to any of these.Currently,
imageSize
is first set to100
, but later falls back to256
if the user input cannot be parsed.