I notice the unix and windows mime code is rather skeletal and incomplete. I want to suggest you simply port the mimemagic gem from Ruby to save time. It is very comprehensive in its coverage of mime types, has a byte-stream recognizer, and does filename extension recognition as well. In my Ruby code I have come to rely upon it and it has helped a lot.
Cheers,
G. Gibson
There has been some work on mime types and I can try to summarize it. The stdlib should be using mime types on the host operating system and as a community we should probably have a shard that covers more mime types.
Have you see the crystal-community repo? I would open an issue there and see if anyone is interested in helping you build out a mime library.
I don't think we're going to add more complexity to the MIME class. It already does filename extension recognition. Byte-stream recognition can easily be added by an external shard.
Most helpful comment
There has been some work on mime types and I can try to summarize it. The stdlib should be using mime types on the host operating system and as a community we should probably have a shard that covers more mime types.
Have you see the crystal-community repo? I would open an issue there and see if anyone is interested in helping you build out a mime library.