Determine the type of an image by reading the first bytes. https://github.com/Icelandjack/Image-type
|Latest on Hackage:||0.1.0.0|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
A package used to determine the type of an image according to its first bytes based on the Python library imghdr.
Most simplest usage is getting the type of a file:
Or to test for a specific extension:
import qualified Data.ByteString as B
testPgm <$> B.readFile "/tmp/file.pgm"
Or to filter files by extension:
getDirectoryContents "." >>= filterM doesFileExist >>= filterM isJpeg
Supports the following extensions: