-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Determine the size of some common image formats.
--   
--   Currently supports PNG, GIF, and JPEG. This package provides a Sink
--   that will consume the minimum number of bytes necessary to determine
--   the image dimensions.
@package imagesize-conduit
@version 1.1


-- | Detect the image size without opening the image itself and retrieving
--   the minimum amount of data.
module Data.Conduit.ImageSize
data Size
Size :: Int -> Int -> Size
[width] :: Size -> Int
[height] :: Size -> Int
data FileFormat
GIF :: FileFormat
PNG :: FileFormat
JPG :: FileFormat
data ImageSizeException
EmptyImage :: ImageSizeException
UnknownImageFormat :: ImageSizeException
BadGIFHeader :: ImageSizeException
BadPNGHeader :: ImageSizeException
BadJPGHeader :: ImageSizeException

-- | 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.
sinkImageInfo :: (Monad m, MonadThrow n) => Consumer ByteString m (n (Size, FileFormat))

-- | Specialized version of <a>sinkImageInfo</a> that returns only the
--   image size.
sinkImageSize :: (Monad m, MonadThrow n, Functor n) => Consumer ByteString m (n Size)
instance GHC.Show.Show Data.Conduit.ImageSize.ImageSizeException
instance GHC.Enum.Enum Data.Conduit.ImageSize.FileFormat
instance GHC.Read.Read Data.Conduit.ImageSize.FileFormat
instance GHC.Classes.Ord Data.Conduit.ImageSize.FileFormat
instance GHC.Classes.Eq Data.Conduit.ImageSize.FileFormat
instance GHC.Show.Show Data.Conduit.ImageSize.FileFormat
instance GHC.Read.Read Data.Conduit.ImageSize.Size
instance GHC.Classes.Ord Data.Conduit.ImageSize.Size
instance GHC.Classes.Eq Data.Conduit.ImageSize.Size
instance GHC.Show.Show Data.Conduit.ImageSize.Size
instance GHC.Exception.Exception Data.Conduit.ImageSize.ImageSizeException
