Library that determines the type of image contained in a file or byte stream, basically clone of the Python imghdr module.
Check the file directly:
```rust
match imghdr::from_file("./tests/images/example.png") { Ok(Some(imghdr::Type::Png)) => println!("Yep, it is a PNG"), Ok(..) => println!("Nope, it is definitely not a PNG"), Err(e) => println!("Some error happened: {:?}", e), }
```
Or check the bytes stream:
```rust
#
let mut file = File::open("./tests/images/example.jpeg")?;
let mut content: Vec
match imghdr::from_bytes(&content) { Some(imghdr::Type::Jpeg) => println!("And this is a Jpeg"), _ => println!("Can a Png, Bmp or other file format"), }
```