in reply to Opinions on determining mime type

if what you have works now, i'd suggest beating it up a bit more ( throw some GIFs at it, or some BMPs ) and see if it reliably handles those. then goof up the suffix and see if it handles that.

if you wanted to try File::MMagic, i'd suggest the same routine of testing to see it's reliability. or, read through the source to see what it's doing differently than you are.