mbrubeck / tree_magic

Determines the MIME type of a file by traversing a filetype tree.
MIT License
34 stars 9 forks source link

Doesn't detect .pam files #20

Open CheerfulPianissimo opened 7 months ago

CheerfulPianissimo commented 7 months ago

Here are a few sample files: https://filesamples.com/formats/pam

The file utility gives "Netpbm PAM image file, size = 640 x 426" and xdg-mime give "image/x-portable-arbitrarymap" but tree_magic_mini gives "application/octet-stream".

Sample code used:

let input: &[u8] = include_bytes!("../sample.pam");
dbg!(tree_magic_mini::from_u8(input));

Found in the context of https://github.com/waycrate/wayshot/issues/107