class MimeMagic

def self.by_magic(io)

This is a slow operation.
Lookup mime type by magic content analysis.
def self.by_magic(io)
  mime = magic_match(io, :find)
  mime && new(mime[0])
end