Function imghdr::open [] [src]

pub fn open<T: AsRef<Path>>(path: T) -> Result<TypeError>

Open file and test if it an image.

Errors

This function will return an std::io::Error if file is inaccessible or can't be read.

Also it will return an std::io::Error with a std::io::ErrorKind::InvalidData kind if file is not an image.

Examples

imghdr.open("/path/to/image.jpg").unwrap();