imghdr
pub fn open<T: AsRef<Path>>(path: T) -> Result<Type, Error>
Open file and test if it an image.
This function will return an std::io::Error if file is inaccessible or can't be read.
std::io::Error
Also it will return an std::io::Error with a std::io::ErrorKind::InvalidData kind if file is not an image.
std::io::ErrorKind::InvalidData
imghdr.open("/path/to/image.jpg").unwrap();