Skip to main content

read_image_dimensions

Function read_image_dimensions 

Source
pub fn read_image_dimensions(path: &Path) -> Option<(u32, u32)>
Expand description

Read image dimensions (width, height) in pixels from a file. Supports PNG, JPEG, and EPS (PostScript BoundingBox).

This is a narrow replacement for Image::Size::imgsize (Perl image_size at Util::Image L86-97). Only a few formats are needed for typical arXiv graphics inclusions — anything else returns None so the caller skips sizing (mirroring Perl’s return unless $w).