Skip to main content

svg_intrinsic_size

Function svg_intrinsic_size 

Source
pub fn svg_intrinsic_size(svg: &str) -> Result<Vec2, ImageImportError>
Expand description

The intrinsic size of an SVG: its viewBox (preferred) or width/height attributes, defaulting to a 1×1 square when none are declared.

Errors with ImageImportError::NotSvg when there is no <svg> root, and ImageImportError::ZeroSize when the determined width or height is ≤ 0 — a nonzero width and height are required for the image to display.