Expand description
The intrinsic size a placement is fitted to, read off an image’s bytes without decoding them.
Enums§
- Image
Import Error - Why an image’s size could not be read.
Functions§
- image_
intrinsic_ size - The intrinsic size of an image, dispatching by kind.
- parse_
length 🔒 - Parse a leading length value, dropping any unit suffix (
px,pt, …). Percentages are not absolute sizes, so they yieldNone. - png_
intrinsic_ size - The intrinsic size of a PNG, read straight from its IHDR chunk — no decoder
needed. A PNG is the 8-byte signature followed by the IHDR chunk, whose data
begins at byte 16: width is the big-endian
u32at bytes 16..20 and height at bytes 20..24.Noneif the signature is wrong, the header is truncated, or a dimension is zero. - size_
from_ 🔒attrs - Read the root
<svg>size: preferviewBox("min-x min-y w h"), else the numeric part ofwidth/height.Nonewhen neither is present. - svg_
intrinsic_ size - The intrinsic size of an SVG: its
viewBox(preferred) orwidth/heightattributes, defaulting to a 1×1 square when none are declared.