Safe Haskell | None |
---|---|
Language | Haskell98 |
Data.Conduit.ImageSize
Description
Detect the image size without opening the image itself and retrieving the minimum amount of data.
- data Size = Size {}
- data FileFormat
- data ImageSizeException
- sinkImageInfo :: (Monad m, MonadThrow n) => Consumer ByteString m (n (Size, FileFormat))
- sinkImageSize :: (Monad m, MonadThrow n, Functor n) => Consumer ByteString m (n Size)
Documentation
data FileFormat #
Instances
data ImageSizeException #
Constructors
EmptyImage | |
UnknownImageFormat | |
BadGIFHeader | |
BadPNGHeader | |
BadJPGHeader |
Instances
sinkImageInfo :: (Monad m, MonadThrow n) => Consumer ByteString m (n (Size, FileFormat)) #
Find out the size of an image. Also returns the file format that parsed correctly. Note that this function does not verify that the file is indeed in the format that it returns, since it looks only at a small part of the header.
sinkImageSize :: (Monad m, MonadThrow n, Functor n) => Consumer ByteString m (n Size) #
Specialized version of sinkImageInfo
that returns only the
image size.