Function image::image_dimensions

source ·
pub fn image_dimensions<P>(path: P) -> ImageResult<(u32, u32)>
where P: AsRef<Path>,
Expand description

Read a tuple containing the (width, height) of the image located at the specified path. This is faster than fully loading the image and then getting its dimensions.

Try ImageReader for more advanced uses, including guessing the format based on the file’s content before its path or manually supplying the format.