Skip to main content

dimensions

Function dimensions 

Source
pub fn dimensions(bytes: &[u8]) -> Option<ImageDimensions>
Expand description

Reads pixel dimensions from a PNG, JPEG, GIF, or WebP header.

The format is selected from its magic bytes. Truncated or malformed headers and unsupported formats return None.