Skip to main content

probe_image_dimensions

Function probe_image_dimensions 

Source
pub fn probe_image_dimensions(path: &str) -> Result<(u32, u32)>
Expand description

Cheap (header-only) dimensions of a local raster image file. The image crate’s ImageReader::into_dimensions builds just enough of the decoder to read its declared dimensions, without decoding any pixel data — unlike every existing paint-time image load in this codebase (image.rs, avatar.rs, mockup.rs, …), which all go through skia_safe::Image::from_encoded and pay for a full raster decode because they need the pixels themselves. A metadata-only query has no such need, so it takes the cheaper of the two paths instead of reusing theirs.