make it work on windows where libmagic is kind of a pain in the ass