The image-type package

[Tags: bsd3, library]

A package used to determine the type of an image according to its first bytes based on the Python library <https://docs.python.org/3/library/imghdr.html imghdr>.

Most simplest usage is getting the type of a file:

>>> import Codec.ImageType >>> getFileType "/tmp/mystery_file" Just "webp"

Or to test for a specific extension:

>>> isPgm "/tmp/file.pgm" True >>> import qualified Data.ByteString as B >>> testPgm <$> B.readFile "/tmp/file.pgm" Just "pgm"

Or to filter files by extension:

>>> import Codec.ImageType >>> import Control.Monad >>> import System.Directory >>> >>> getDirectoryContents "." >>= filterM doesFileExist >>= filterM isJpeg ["file2.jpeg","file1.jpeg"]

Supports the following extensions: @JPEG@, @PNG@, @GIF@, @TIFF@, @RGB@, @PBM@, @PGM@, @PPM@, @RAST@, @XBM@, @BMP@, @WebP@, @EXR@.

Properties

Version0.1.0.0
Change logNone available
Dependenciesbase (==4.*), bytestring (>=0.9 && <0.11)
LicenseBSD3
AuthorBaldur Blöndal
Maintainerbaldurpet@gmail.com
CategoryGraphics
Home pagehttps://github.com/Icelandjack/Image-type
UploadedMon Aug 4 17:27:07 UTC 2014 by BaldurBlondal
UpdatedTue Aug 5 04:20:48 UTC 2014 by BaldurBlondal to revision 1
DistributionsNixOS:0.1.0.0
Downloads135 total (9 in last 30 days)
StatusDocs available [build log]
Successful builds reported [all 1 reports]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees