Crate imsz

Crate imsz 

Source
Expand description

Get image width and height reading as few bytes as possible.

GitHubC API Reference

Example:

use imsz::imsz;
 
let fname = "testdata/image.gif";
let info = imsz(fname)?;
println!("{}: {}, {} x {}", fname, info.format, info.width, info.height);
// testdata/image.gif: GIF, 32 x 16
 
// alternatively if you have something implementing std::io::Read and std::io::Seek:
use imsz::imsz_from_reader;
 
let mut file = BufReader::new(File::open(fname)?);
let info = imsz_from_reader(&mut file)?;

Structs§

ImInfo
The width, height and format of an image.

Enums§

ImError
ImFormat

Traits§

Imsz
Trait to provide generic imsz() function for paths, buffers, and readers.

Functions§

imsz
Read width and height of an image.
imsz_from_path
Read width and height of an image.
imsz_from_reader
Read width and height of an image.

Type Aliases§

ImResult