[−][src]Function imghdr::open
pub fn open<T: AsRef<Path>>(path: T) -> Result<Type, Error>
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
ⓘThis example is not tested
imghdr.open("/path/to/image.jpg").unwrap();