diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # Change log
 
+## Release 1.0.0
+
+* Updated dependency bounds.
+
 ## Release 0.4.4
 
 * Added the `imageMetadata` compiler, to extract metadata from images.
diff --git a/LICENSE.md b/LICENSE.md
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,4 +1,4 @@
-Copyright 2019 Laurent P. René de Cotret
+Copyright 2018-2020 Laurent P. René de Cotret
 
 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
 
@@ -8,4 +8,4 @@
 
 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
 
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -37,7 +37,7 @@
         route idRoute
         compile $ loadImage 
             >>= resizeImageCompiler 64 48
-            >>= compressJpg 50
+            >>= compressJpgCompiler 50
 
     -- Scale images to fit within a 600x400 box
     -- Aspect ratio will be preserved
@@ -78,16 +78,10 @@
 
 The documentation for the latest release is available on the [Hackage page](http://hackage.haskell.org/package/hakyll-images/). 
 
-## Upcoming features
-
-Here are the upcoming features of `hakyll-images`:
-
-- [ ] Format conversion
-
 ## Support  Issues / Feature requests
 
 All support requests (e.g. installation issues, unclear documentation, bugs, etc.) should of [filed on Github as an issue](https://github.com/LaurentRDC/hakyll-images/issues/)
 
 ## License
 
-This package is made available under the BSD 3-clause license. For more details, see the [LICENSE.md](https://github.com/LaurentRDC/hakyll-images/blob/master/LICENSE.md)
+This package is made available under the BSD 3-clause license. For more details, see the [LICENSE.md](https://github.com/LaurentRDC/hakyll-images/blob/master/LICENSE.md)
diff --git a/hakyll-images.cabal b/hakyll-images.cabal
--- a/hakyll-images.cabal
+++ b/hakyll-images.cabal
@@ -1,13 +1,13 @@
-cabal-version: 1.12
+cabal-version: 2.2
 
--- This file has been generated from package.yaml by hpack version 0.31.2.
+-- This file has been generated from package.yaml by hpack version 0.33.0.
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: b8546296308b75bbf655dd856a069155995bfa86cef044e6b1366acc46a813aa
+-- hash: 545c4d291679bf352c162203073efbd820aec74046f6c1c84fb65ae5ff5e18f8
 
 name:           hakyll-images
-version:        0.4.4
+version:        1.0.0
 synopsis:       Hakyll utilities to work with images
 description:    hakyll-images is an add-on to the hakyll package. It adds utilities to work with images, including JPEG compression.
 category:       Web
@@ -15,13 +15,12 @@
 bug-reports:    https://github.com/LaurentRDC/hakyll-images/issues
 author:         Laurent P. René de Cotret
 maintainer:     Laurent P. René de Cotret
-license:        BSD3
+license:        BSD-3-Clause
 license-file:   LICENSE.md
 build-type:     Simple
 extra-source-files:
     CHANGELOG.md
     LICENSE.md
-    package.yaml
     README.md
     stack.yaml
 data-files:
@@ -40,15 +39,17 @@
       Hakyll.Images.Common
       Hakyll.Images.Metadata
       Paths_hakyll_images
+  autogen-modules:
+      Paths_hakyll_images
   hs-source-dirs:
       library
   ghc-options: -Wall -Wcompat
   build-depends:
-      JuicyPixels >=3
-    , JuicyPixels-extra >0.3
+      JuicyPixels >=3 && <4
+    , JuicyPixels-extra >0.3 && <1
     , base >=4.8 && <5
-    , binary >=0.5 && <0.10
-    , bytestring >=0.9 && <0.11
+    , binary >=0.5 && <1
+    , bytestring >=0.9 && <1
     , hakyll >4
   default-language: Haskell2010
 
@@ -72,11 +73,11 @@
   ghc-options: -Wall -Wcompat
   build-depends:
       HUnit-approx >=1 && <2
-    , JuicyPixels >=3
-    , JuicyPixels-extra >0.3
+    , JuicyPixels >=3 && <4
+    , JuicyPixels-extra >0.3 && <1
     , base >=4.8 && <5
-    , binary >=0.5 && <0.10
-    , bytestring >=0.9 && <0.11
+    , binary >=0.5 && <1
+    , bytestring >=0.9 && <1
     , directory >=1 && <2
     , filepath >=1 && <2
     , hakyll >4
diff --git a/library/Hakyll/Images.hs b/library/Hakyll/Images.hs
--- a/library/Hakyll/Images.hs
+++ b/library/Hakyll/Images.hs
@@ -1,79 +1,78 @@
-
-{-|
-Module      : Hakyll.Images
-Description : Hakyll utilities for image files
-Copyright   : (c) Laurent P René de Cotret, 2019
-License     : BSD3
-Maintainer  : laurent.decotret@outlook.com
-Stability   : unstable
-Portability : portable
-
-This package defines a few Hakyll compilers. These compilers help deal with images
-in the context of Hakyll programs, such as JPEG compression or image resizing.
-
-Items must be loaded before compilers can be used, like so:
-
-@
-    import Hakyll
-    import Hakyll.Images        ( loadImage
-                                , resizeImageCompiler 
-                                )
-    
-    hakyll $ do
-
-        -- Resize all profile pictures with .png extensions to 64x48
-        match "profiles/**.png" $ do
-            route idRoute
-            compile $ loadImage
-                >>= resizeImageCompiler 64 48
-        
-        (... omitted ...)
-@
-
-Compilers can be sequenced easily as well:
-
-@
-    import Hakyll
-    import Hakyll.Images        ( loadImage
-                                , compressJpgCompiler
-                                , scaleImageCompiler 
-                                )
-    
-    hakyll $ do
-
-        -- Resize all JPEgs to fit inside of 800x600
-        -- Also compress to a quality of 25/100
-        match "pictures/**.jpg" $ do
-            route idRoute
-            compile $ loadImage
-                >>= scaleImageCompiler 800 600
-                >>= compressJpgCompiler 25
-        
-        (... omitted ...)
-@
-
--}
-module Hakyll.Images (
-    -- Basic types and functions
-      Image
-    , loadImage
+-- |
+-- Module      : Hakyll.Images
+-- Description : Hakyll utilities for image files
+-- Copyright   : (c) Laurent P René de Cotret, 2019
+-- License     : BSD3
+-- Maintainer  : laurent.decotret@outlook.com
+-- Stability   : unstable
+-- Portability : portable
+--
+-- This package defines a few Hakyll compilers. These compilers help deal with images
+-- in the context of Hakyll programs, such as JPEG compression or image resizing.
+--
+-- Items must be loaded before compilers can be used, like so:
+--
+-- @
+--     import Hakyll
+--     import Hakyll.Images        ( loadImage
+--                                 , resizeImageCompiler
+--                                 )
+--
+--     hakyll $ do
+--
+--         -- Resize all profile pictures with .png extensions to 64x48
+--         match "profiles/**.png" $ do
+--             route idRoute
+--             compile $ loadImage
+--                 >>= resizeImageCompiler 64 48
+--
+--         (... omitted ...)
+-- @
+--
+-- Compilers can be sequenced easily as well:
+--
+-- @
+--     import Hakyll
+--     import Hakyll.Images        ( loadImage
+--                                 , compressJpgCompiler
+--                                 , scaleImageCompiler
+--                                 )
+--
+--     hakyll $ do
+--
+--         -- Resize all JPEgs to fit inside of 800x600
+--         -- Also compress to a quality of 25/100
+--         match "pictures/**.jpg" $ do
+--             route idRoute
+--             compile $ loadImage
+--                 >>= scaleImageCompiler 800 600
+--                 >>= compressJpgCompiler 25
+--
+--         (... omitted ...)
+-- @
+module Hakyll.Images
+  ( -- Basic types and functions
+    Image,
+    loadImage,
     -- Handling metadata
-    , module Hakyll.Images.Metadata
+    module Hakyll.Images.Metadata,
     -- Jpg compression
-    , JpgQuality
-    , compressJpg
-    , compressJpgCompiler
+    JpgQuality,
+    compressJpg,
+    compressJpgCompiler,
     -- Image scaling
-    , Width, Height
-    , resize
-    , resizeImageCompiler
-    , scale
-    , scaleImageCompiler
-    , ensureFit
-    , ensureFitCompiler
-) where
+    Width,
+    Height,
+    resize,
+    resizeImageCompiler,
+    scale,
+    scaleImageCompiler,
+    ensureFit,
+    ensureFitCompiler,
+  )
+where
 
+import Hakyll.Images.Common
 import Hakyll.Images.CompressJpg
+import Hakyll.Images.Metadata
 import Hakyll.Images.Resize
-import Hakyll.Images.Common
-import Hakyll.Images.Metadata
diff --git a/library/Hakyll/Images/Common.hs b/library/Hakyll/Images/Common.hs
--- a/library/Hakyll/Images/Common.hs
+++ b/library/Hakyll/Images/Common.hs
@@ -1,72 +1,64 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE TypeSynonymInstances #-}
-{-# LANGUAGE FlexibleInstances    #-}
-{-# LANGUAGE DeriveDataTypeable   #-}
-{-# LANGUAGE DeriveGeneric        #-}
-{-|
-Module      : Hakyll.Images.Common
-Description : Types and utilities for Hakyll.Images
-Copyright   : (c) Laurent P René de Cotret, 2019
-License     : BSD3
-Maintainer  : laurent.decotret@outlook.com
-Stability   : unstable
-Portability : portable
--}
 
-module Hakyll.Images.Common ( Image(..)
-                            , ImageFormat(..)
-                            , loadImage
-                            , encode
-                            ) where
-
-import Prelude                          hiding (readFile)
-
+-- |
+-- Module      : Hakyll.Images.Common
+-- Description : Types and utilities for Hakyll.Images
+-- Copyright   : (c) Laurent P René de Cotret, 2019
+-- License     : BSD3
+-- Maintainer  : laurent.decotret@outlook.com
+-- Stability   : unstable
+-- Portability : portable
+module Hakyll.Images.Common
+  ( Image (..),
+    ImageFormat (..),
+    loadImage,
+    encode,
+  )
+where
 
-import Codec.Picture.Types              (DynamicImage)
 import Codec.Picture.Saving
-
-import Data.Binary                      (Binary(..))
-import Data.ByteString.Lazy             (toStrict)
-import Data.ByteString                  (ByteString)
-import Data.Char                        (toLower)
-import Data.Typeable                    (Typeable)
-import GHC.Generics                     (Generic)
-
-import Hakyll.Core.Compiler             (Compiler, getResourceLBS, getUnderlyingExtension)
-import Hakyll.Core.Item                 (Item(..))
-import Hakyll.Core.Writable             (Writable(..))
-
+import Codec.Picture.Types (DynamicImage)
+import Data.Binary (Binary (..))
+import Data.ByteString (ByteString)
+import Data.ByteString.Lazy (toStrict)
+import Data.Char (toLower)
+import Data.Typeable (Typeable)
+import GHC.Generics (Generic)
+import Hakyll.Core.Compiler (Compiler, getResourceLBS, getUnderlyingExtension)
+import Hakyll.Core.Item (Item (..))
+import Hakyll.Core.Writable (Writable (..))
+import Prelude hiding (readFile)
 
 -- Supported (i.e. encodable) image formats
 data ImageFormat
-    = Jpeg 
-    | Png
-    | Bitmap
-    | Tiff
-    deriving (Eq, Generic)
-
+  = Jpeg
+  | Png
+  | Bitmap
+  | Tiff
+  deriving (Eq, Generic)
 
 -- Automatic derivation of Binary instances requires Generic
 instance Binary ImageFormat
 
-
-data Image = Image { format :: ImageFormat
-                   , image :: ByteString
-                   }
-    deriving (Typeable)
-
+data Image = Image
+  { format :: ImageFormat,
+    image :: ByteString
+  }
+  deriving (Typeable)
 
 -- When writing to disk, we ignore the image format.
 -- Trusting users to route correctly.
 instance Writable Image where
-    -- Write the bytestring content
-    write fp item  = write fp (image <$> item)
-
+  -- Write the bytestring content
+  write fp item = write fp (image <$> item)
 
 -- Binary instance looks similar to the binary instance for a Hakyll Item
 instance Binary Image where
-    put (Image fmt content) = put fmt >> put content
-    get                     = Image <$> get <*> get
-
+  put (Image fmt content) = put fmt >> put content
+  get = Image <$> get <*> get
 
 -- | Load an image from a file.
 -- This function can be combined with other compilers.
@@ -74,15 +66,14 @@
 -- @
 -- match "*.jpg" $ do
 --     route idRoute
---     compile $ loadImage 
+--     compile $ loadImage
 --         >>= compressJpgCompiler 50
 -- @
 loadImage :: Compiler (Item Image)
 loadImage = do
-    content <- fmap toStrict <$> getResourceLBS
-    fmt <- fromExt <$> getUnderlyingExtension
-    return $ (Image fmt) <$> content
-
+  content <- fmap toStrict <$> getResourceLBS
+  fmt <- fromExt <$> getUnderlyingExtension
+  return $ (Image fmt) <$> content
 
 -- | Translation between file extensions and image formats.
 -- It is important to keep track of image formats because Hakyll
@@ -91,19 +82,18 @@
 -- This function is case-insensitive
 fromExt :: String -> ImageFormat
 fromExt ext = fromExt' $ toLower <$> ext
-    where
-        fromExt' ".jpeg" = Jpeg
-        fromExt' ".jpg"  = Jpeg
-        fromExt' ".png"  = Png
-        fromExt' ".bmp"  = Bitmap
-        fromExt' ".tif"  = Tiff
-        fromExt' ".tiff" = Tiff
-        fromExt' ext'     = error $ "Unsupported format: " <> ext'
-
+  where
+    fromExt' ".jpeg" = Jpeg
+    fromExt' ".jpg" = Jpeg
+    fromExt' ".png" = Png
+    fromExt' ".bmp" = Bitmap
+    fromExt' ".tif" = Tiff
+    fromExt' ".tiff" = Tiff
+    fromExt' ext' = error $ "Unsupported format: " <> ext'
 
 -- Encode images based on file extension
 encode :: ImageFormat -> DynamicImage -> Image
-encode Jpeg im   = Image Jpeg   $ (toStrict . imageToJpg 100) im
-encode Png im    = Image Png    $ (toStrict . imageToPng) im
+encode Jpeg im = Image Jpeg $ (toStrict . imageToJpg 100) im
+encode Png im = Image Png $ (toStrict . imageToPng) im
 encode Bitmap im = Image Bitmap $ (toStrict . imageToBitmap) im
-encode Tiff im   = Image Tiff   $ (toStrict . imageToTiff) im
+encode Tiff im = Image Tiff $ (toStrict . imageToTiff) im
diff --git a/library/Hakyll/Images/CompressJpg.hs b/library/Hakyll/Images/CompressJpg.hs
--- a/library/Hakyll/Images/CompressJpg.hs
+++ b/library/Hakyll/Images/CompressJpg.hs
@@ -1,75 +1,70 @@
-
-{-|
-Module      : Hakyll.Images.CompressJpg
-Description : Hakyll compiler to compress Jpeg images
-Copyright   : (c) Laurent P René de Cotret, 2019
-License     : BSD3
-Maintainer  : laurent.decotret@outlook.com
-Stability   : unstable
-Portability : portable
-
-This module defines a Hakyll compiler, 'compressJpgCompiler', which can be used to
-re-encode Jpeg images at a lower quality during website compilation. Original images are
-left unchanged, but compressed images can be up to 10x smaller.
-
-The @compressJpgCompiler@ is expected to be used like this:
-
-@
-    import Hakyll
-    import Hakyll.Images        ( loadImage
-                                , compressJpgCompiler
-                                )
-    
-    hakyll $ do
-
-        -- Compress all source Jpegs to a Jpeg quality of 50
-        match "images/**.jpg" $ do
-            route idRoute
-            compile $ loadImage
-                >>= compressJpgCompiler 50
-        
-        (... omitted ...)
-@
--}
+-- |
+-- Module      : Hakyll.Images.CompressJpg
+-- Description : Hakyll compiler to compress Jpeg images
+-- Copyright   : (c) Laurent P René de Cotret, 2019
+-- License     : BSD3
+-- Maintainer  : laurent.decotret@outlook.com
+-- Stability   : unstable
+-- Portability : portable
+--
+-- This module defines a Hakyll compiler, 'compressJpgCompiler', which can be used to
+-- re-encode Jpeg images at a lower quality during website compilation. Original images are
+-- left unchanged, but compressed images can be up to 10x smaller.
+--
+-- The @compressJpgCompiler@ is expected to be used like this:
+--
+-- @
+--     import Hakyll
+--     import Hakyll.Images        ( loadImage
+--                                 , compressJpgCompiler
+--                                 )
+--
+--     hakyll $ do
+--
+--         -- Compress all source Jpegs to a Jpeg quality of 50
+--         match "images/**.jpg" $ do
+--             route idRoute
+--             compile $ loadImage
+--                 >>= compressJpgCompiler 50
+--
+--         (... omitted ...)
+-- @
 module Hakyll.Images.CompressJpg
-    ( JpgQuality
-    , compressJpgCompiler
-    , compressJpg
-    ) where
-
-import Data.ByteString.Lazy             (toStrict)
-
-import Codec.Picture.Jpg                (decodeJpeg)
-import Codec.Picture.Saving             (imageToJpg)
-
-import Hakyll.Core.Item                 (Item(..))
-import Hakyll.Core.Compiler             (Compiler)
-
-import Hakyll.Images.Common             ( Image(..)
-                                        , ImageFormat(..)
-                                        , image
-                                        , format
-                                        )
+  ( JpgQuality,
+    compressJpgCompiler,
+    compressJpg,
+  )
+where
 
+import Codec.Picture.Jpg (decodeJpeg)
+import Codec.Picture.Saving (imageToJpg)
+import Data.ByteString.Lazy (toStrict)
+import Hakyll.Core.Compiler (Compiler)
+import Hakyll.Core.Item (Item (..))
+import Hakyll.Images.Common
+  ( Image (..),
+    ImageFormat (..),
+    format,
+    image,
+  )
 
 -- | Jpeg encoding quality, from 0 (lower quality) to 100 (best quality).
 type JpgQuality = Int
 
-
 -- | Compress a JPG bytestring to a certain quality setting.
 -- The quality should be between 0 (lowest quality) and 100 (best quality).
--- An error is raised if the image cannot be decoded, or if the 
+-- An error is raised if the image cannot be decoded, or if the
 -- encoding quality is out-of-bounds
 compressJpg :: JpgQuality -> Image -> Image
-compressJpg quality src = if (format src) /= Jpeg
-        then error $ "Image is not a JPEG."
-        else 
-            case decodeJpeg $ image src of
-                Left _         -> error $ "Loading the image failed."
-                Right dynImage -> 
-                    if (quality < 0 || quality > 100)
-                        then error $ "JPEG encoding quality should be between 0 and 100."
-                        else Image Jpeg $ (toStrict $ imageToJpg quality dynImage)
+compressJpg quality src =
+  if (format src) /= Jpeg
+    then error $ "Image is not a JPEG."
+    else case decodeJpeg $ image src of
+      Left _ -> error $ "Loading the image failed."
+      Right dynImage ->
+        if (quality < 0 || quality > 100)
+          then error $ "JPEG encoding quality should be between 0 and 100."
+          else Image Jpeg $ (toStrict $ imageToJpg quality dynImage)
 
 -- | Compiler that compresses a JPG image to a certain quality setting.
 -- The quality should be between 0 (lowest quality) and 100 (best quality).
@@ -78,8 +73,8 @@
 -- @
 -- match "*.jpg" $ do
 --     route idRoute
---     compile $ loadImage 
+--     compile $ loadImage
 --         >>= compressJpgCompiler 50
 -- @
 compressJpgCompiler :: JpgQuality -> Item Image -> Compiler (Item Image)
-compressJpgCompiler quality item = return $ compressJpg quality <$> item 
+compressJpgCompiler quality = return . fmap (compressJpg quality)
diff --git a/library/Hakyll/Images/Metadata.hs b/library/Hakyll/Images/Metadata.hs
--- a/library/Hakyll/Images/Metadata.hs
+++ b/library/Hakyll/Images/Metadata.hs
@@ -1,35 +1,31 @@
-
-{-|
-Module      : Hakyll.Images.Metadata
-Description : Handling image metadata
-Copyright   : (c) Laurent P René de Cotret, 2019
-License     : BSD3
-Maintainer  : laurent.decotret@outlook.com
-Stability   : unstable
-Portability : portable
--}
-module Hakyll.Images.Metadata 
-    ( module Codec.Picture.Metadata
-    , imageMetadata
-    , metadata
-    ) where
-
-import Codec.Picture                    (decodeImageWithMetadata)
-import Codec.Picture.Metadata           
-
-import Hakyll.Core.Compiler             (Compiler)
-import Hakyll.Core.Item                 (Item, itemBody)
+-- |
+-- Module      : Hakyll.Images.Metadata
+-- Description : Handling image metadata
+-- Copyright   : (c) Laurent P René de Cotret, 2019
+-- License     : BSD3
+-- Maintainer  : laurent.decotret@outlook.com
+-- Stability   : unstable
+-- Portability : portable
+module Hakyll.Images.Metadata
+  ( module Codec.Picture.Metadata,
+    imageMetadata,
+    metadata,
+  )
+where
 
-import Hakyll.Images.Common             (Image(..))
+import Codec.Picture (decodeImageWithMetadata)
+import Codec.Picture.Metadata
+import Hakyll.Core.Compiler (Compiler)
+import Hakyll.Core.Item (Item, itemBody)
+import Hakyll.Images.Common (Image (..))
 
--- | Extract metadata from an image. This function will throw an 
+-- | Extract metadata from an image. This function will throw an
 -- error in case of a problem.
 --
 -- This function is for testing purposes.
 metadata :: Image -> Metadatas
 metadata im = either error snd (decodeImageWithMetadata (image im))
 
-
 -- | Extract metadata from an image.
 --
 -- @
@@ -42,4 +38,4 @@
 --         ...
 -- @
 imageMetadata :: Item Image -> Compiler Metadatas
-imageMetadata = return . metadata . itemBody
+imageMetadata = return . metadata . itemBody
diff --git a/library/Hakyll/Images/Resize.hs b/library/Hakyll/Images/Resize.hs
--- a/library/Hakyll/Images/Resize.hs
+++ b/library/Hakyll/Images/Resize.hs
@@ -1,72 +1,70 @@
-
-{-|
-Module      : Hakyll.Images.Resize
-Description : Hakyll compiler to resize images
-Copyright   : (c) Laurent P René de Cotret, 2019
-License     : BSD3
-Maintainer  : laurent.decotret@outlook.com
-Stability   : unstable
-Portability : portable
-
-This module defines two Hakyll compilers. The first one, 'resizeImageCompiler', 
-is used to resize images to specific dimensions. The aspect ratio might not be the same.
-
-The other compiler, `scaleImageCompiler`, scales images to fit within a specified 
-box while preserving aspect ratio.
-
-@
-    import Hakyll
-    import Hakyll.Images        ( loadImage
-                                , resizeImageCompiler 
-                                , scaleImageCompiler
-                                )
-    
-    hakyll $ do
-
-        -- Resize all profile pictures with .png extensions to 64x48
-        match "profiles/**.png" $ do
-            route idRoute
-            compile $ loadImage
-                >>= resizeImageCompiler 64 48
-        
-        -- Scale images to fit within a 600x400 box
-        match "images/**" $ do
-            route idRoute
-            compile $ loadImage
-                >>= scaleImageCompiler 600 400
-        
-        (... omitted ...)
-@
--}
+-- |
+-- Module      : Hakyll.Images.Resize
+-- Description : Hakyll compiler to resize images
+-- Copyright   : (c) Laurent P René de Cotret, 2019
+-- License     : BSD3
+-- Maintainer  : laurent.decotret@outlook.com
+-- Stability   : unstable
+-- Portability : portable
+--
+-- This module defines two Hakyll compilers. The first one, 'resizeImageCompiler',
+-- is used to resize images to specific dimensions. The aspect ratio might not be the same.
+--
+-- The other compiler, `scaleImageCompiler`, scales images to fit within a specified
+-- box while preserving aspect ratio.
+--
+-- @
+--     import Hakyll
+--     import Hakyll.Images        ( loadImage
+--                                 , resizeImageCompiler
+--                                 , scaleImageCompiler
+--                                 )
+--
+--     hakyll $ do
+--
+--         -- Resize all profile pictures with .png extensions to 64x48
+--         match "profiles/**.png" $ do
+--             route idRoute
+--             compile $ loadImage
+--                 >>= resizeImageCompiler 64 48
+--
+--         -- Scale images to fit within a 600x400 box
+--         match "images/**" $ do
+--             route idRoute
+--             compile $ loadImage
+--                 >>= scaleImageCompiler 600 400
+--
+--         (... omitted ...)
+-- @
 module Hakyll.Images.Resize
-    ( Width, Height
-    , resize
-    , resizeImageCompiler
-    , scale
-    , scaleImageCompiler
-    , ensureFit
-    , ensureFitCompiler
-    ) where
-
-import Codec.Picture            (convertRGBA8, decodeImage)
-import Codec.Picture.Types      (DynamicImage(..), imageHeight, imageWidth)
-import Codec.Picture.Extra      (scaleBilinear)
-
-import Data.ByteString          (ByteString)
-import Data.Ratio               ((%))
-
-import Hakyll.Core.Item         (Item(..))
-import Hakyll.Core.Compiler     (Compiler)
+  ( Width,
+    Height,
+    resize,
+    resizeImageCompiler,
+    scale,
+    scaleImageCompiler,
+    ensureFit,
+    ensureFitCompiler,
+  )
+where
 
-import Hakyll.Images.Common     (Image(..), encode)
+import Codec.Picture (convertRGBA8, decodeImage)
+import Codec.Picture.Extra (scaleBilinear)
+import Codec.Picture.Types (DynamicImage (..), imageHeight, imageWidth)
+import Data.ByteString (ByteString)
+import Data.Ratio ((%))
+import Hakyll.Core.Compiler (Compiler)
+import Hakyll.Core.Item (Item (..))
+import Hakyll.Images.Common (Image (..), encode)
 
 type Width = Int
+
 type Height = Int
 
 decodeImage' :: ByteString -> DynamicImage
 decodeImage' im = case decodeImage im of
-    Left msg -> error msg
-    Right im' -> im' 
+  Left msg -> error msg
+  Right im' -> im'
 
 -- | Resize an image to specified width and height using the bilinear transform.
 -- The aspect ratio may not be respected.
@@ -78,7 +76,7 @@
 
 -- | Scale an image to a size that will fit in the specified width and height,
 -- while preserving aspect ratio. Images might be scaled up as well.
--- 
+--
 -- In the process, an image is converted to RGBA8. Therefore, some information
 -- loss may occur.
 --
@@ -88,30 +86,37 @@
 
 -- | Scale an image to a size that will fit in the specified width and height,
 -- while preserving aspect ratio. Images might be scaled up as well.
--- 
+--
 -- In the process, an image is converted to RGBA8. Therefore, some information
 -- loss may occur.
-scale' :: Width         -- ^ Desired width.
-       -> Height        -- ^ Desired height.
-       -> Bool          -- ^ Allow scaling up as well.
-       -> DynamicImage  -- ^ Source image
-       -> DynamicImage  -- ^ Scaled image.
+scale' ::
+  -- | Desired width.
+  Width ->
+  -- | Desired height.
+  Height ->
+  -- | Allow scaling up as well.
+  Bool ->
+  -- | Source image
+  DynamicImage ->
+  -- | Scaled image.
+  DynamicImage
 scale' w h upAllowed img = resize maxWidth maxHeight img
-    where
-        img' = convertRGBA8 img -- Required to extract height and width
-        (imgWidth, imgHeight) = (imageWidth img', imageHeight img')
-        -- Find the smallest resizing that will accomodate both the width 
-        -- and height.
-        -- If we don't allow scaling up, minimum scaling is 1
-        resizing = if upAllowed 
-            then min (w % imgWidth) (h % imgHeight)
-            else minimum [w % imgWidth, h % imgHeight, 1]
-        maxWidth = round (resizing * fromIntegral imgWidth)
-        maxHeight = round (resizing * fromIntegral imgHeight)
+  where
+    img' = convertRGBA8 img -- Required to extract height and width
+    (imgWidth, imgHeight) = (imageWidth img', imageHeight img')
+    -- Find the smallest resizing that will accomodate both the width
+    -- and height.
+    -- If we don't allow scaling up, minimum scaling is 1
+    resizing =
+      if upAllowed
+        then min (w % imgWidth) (h % imgHeight)
+        else minimum [w % imgWidth, h % imgHeight, 1]
+    maxWidth = round (resizing * fromIntegral imgWidth)
+    maxHeight = round (resizing * fromIntegral imgHeight)
 
 -- | Scale an image down to a size that will fit in the specified width and height,
 -- while preserving aspect ratio.
--- 
+--
 -- In the process, an image is converted to RGBA8. Therefore, some information
 -- loss may occur.
 --
@@ -125,7 +130,7 @@
 -- @
 -- match "*.png" $ do
 --     route idRoute
---     compile $ loadImage 
+--     compile $ loadImage
 --         >>= resizeImageCompiler 48 64
 -- @
 --
@@ -133,8 +138,8 @@
 -- To preserve aspect ratio, take a look at 'scaleImageCompiler'.
 resizeImageCompiler :: Width -> Height -> Item Image -> Compiler (Item Image)
 resizeImageCompiler w h item =
-    let fmt = (format . itemBody) item
-    in return $ (encode fmt . resize w h . decodeImage' . image) <$> item
+  let fmt = (format . itemBody) item
+   in return $ (encode fmt . resize w h . decodeImage' . image) <$> item
 
 -- | Compiler that rescales images to fit within dimensions. Aspect ratio
 -- will be preserved. Images might be scaled up as well.
@@ -142,7 +147,7 @@
 -- @
 -- match "*.tiff" $ do
 --     route idRoute
---     compile $ loadImage 
+--     compile $ loadImage
 --         >>= scaleImageCompiler 48 64
 -- @
 --
@@ -150,22 +155,22 @@
 -- To ensure images are only scaled __down__, take a look at 'ensureFitCompiler'.
 scaleImageCompiler :: Width -> Height -> Item Image -> Compiler (Item Image)
 scaleImageCompiler w h item =
-    let fmt = (format . itemBody) item
-    in return $ (encode fmt . scale w h . decodeImage' . image) <$> item
+  let fmt = (format . itemBody) item
+   in return $ (encode fmt . scale w h . decodeImage' . image) <$> item
 
--- | Compiler that ensures images will fit within dimensions. Images might 
+-- | Compiler that ensures images will fit within dimensions. Images might
 -- be scaled down, but never up.  Aspect ratio will be preserved.
 --
 -- @
 -- match "*.tiff" $ do
 --     route idRoute
---     compile $ loadImage 
+--     compile $ loadImage
 --         >>= ensureFitCompiler 48 64
 -- @
 --
 -- Note that in the resizing process, images will be converted to RGBA8.
 -- To allow the possibility of scaling up, take a look at 'scaleImageCompiler'.
 ensureFitCompiler :: Width -> Height -> Item Image -> Compiler (Item Image)
-ensureFitCompiler w h item  = 
-    let fmt = (format . itemBody) item
-    in return $ (encode fmt . ensureFit w h . decodeImage' . image) <$> item
+ensureFitCompiler w h item =
+  let fmt = (format . itemBody) item
+   in return $ (encode fmt . ensureFit w h . decodeImage' . image) <$> item
diff --git a/package.yaml b/package.yaml
deleted file mode 100644
--- a/package.yaml
+++ /dev/null
@@ -1,59 +0,0 @@
-name: hakyll-images
-version: '0.4.4'
-github: "LaurentRDC/hakyll-images"
-license: BSD3
-author: "Laurent P. René de Cotret"
-maintainer: "Laurent P. René de Cotret"
-synopsis: "Hakyll utilities to work with images"
-description: 
-  hakyll-images is an add-on to the hakyll package. It adds utilities to work
-  with images, including JPEG compression. 
-category: Web
-license-file: LICENSE.md
-
-extra-source-files:
-- CHANGELOG.md
-- LICENSE.md
-- package.yaml
-- README.md
-- stack.yaml
-
-data-files:
-- tests\data\*.jpg
-
-ghc-options: -Wall -Wcompat
-
-library:
-  dependencies:
-  - base              >= 4.8 && < 5
-  - binary            >= 0.5 && < 0.10
-  - bytestring        >= 0.9 && < 0.11
-  - hakyll            > 4
-  - JuicyPixels       >= 3
-  - JuicyPixels-extra > 0.3
-  source-dirs: library
-  exposed-modules:
-  - Hakyll.Images
-  - Hakyll.Images.CompressJpg
-  - Hakyll.Images.Resize
-
-tests:
-  spec:
-    source-dirs: 
-      - tests
-      - library
-    main: TestSuite.hs
-    dependencies:
-    - hakyll-images
-    - tasty             >= 0.11 && < 2
-    - tasty-hunit       >= 0.9  && < 1
-    - HUnit-approx      >= 1    && < 2
-    - filepath          >= 1    && < 2
-    - directory         >= 1    && < 2
-    # Base hakyll-images dependencies
-    - base              >= 4.8 && < 5
-    - binary            >= 0.5 && < 0.10
-    - bytestring        >= 0.9 && < 0.11
-    - hakyll            > 4
-    - JuicyPixels       >= 3
-    - JuicyPixels-extra > 0.3
diff --git a/stack.yaml b/stack.yaml
--- a/stack.yaml
+++ b/stack.yaml
@@ -1,65 +1,31 @@
-# This file was automatically generated by 'stack init'
-#
-# Some commonly used options have been documented as comments in this file.
-# For advanced use and comprehensive documentation of the format, please see:
-# https://docs.haskellstack.org/en/stable/yaml_configuration/
-
-# Resolver to choose a 'specific' stackage snapshot or a compiler version.
-# A snapshot resolver dictates the compiler version and the set of packages
-# to be used for project dependencies. For example:
-#
-# resolver: lts-3.5
-# resolver: nightly-2015-09-21
-# resolver: ghc-7.10.2
-# resolver: ghcjs-0.1.0_ghc-7.10.2
-#
-# The location of a snapshot can be provided as a file or url. Stack assumes
-# a snapshot provided as a file might change, whereas a url resource does not.
-#
-# resolver: ./custom-snapshot.yaml
-# resolver: https://example.com/snapshots/2018-01-01.yaml
-resolver: lts-12.26
+resolver: nightly-2020-10-11 # GHC 8.10.2
 
-# User packages to be built.
-# Various formats can be used as shown in the example below.
-#
-# packages:
-# - some-directory
-# - https://example.com/foo/bar/baz-0.0.2.tar.gz
-# - location:
-#    git: https://github.com/commercialhaskell/stack.git
-#    commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
-# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a
-#  subdirs:
-#  - auto-update
-#  - wai
 packages:
 - .
-# Dependency packages to be pulled from upstream that are not in the resolver
-# using the same syntax as the packages field.
-# (e.g., acme-missiles-0.3)
-# extra-deps: []
 
-# Override default flag values for local packages and extra-deps
-# flags: {}
+# GHC 8.10.2 is broken on Windows:
+#   https://gitlab.haskell.org/ghc/ghc/-/issues/18550
+compiler: ghc-8.10.1
 
-# Extra package databases containing global packages
-# extra-package-dbs: []
+extra-deps:
+- pandoc-2.11.1
+- citeproc-0.1.0.3@sha256:c73f601fad72d6d74312ae55895e16e2425d86467a16d9a6d1156c6c78d04b62,5395   
+- commonmark-0.1.1@sha256:a928f6a36a7e10dceed252a9bb8670c01affbe89d70d81d4ba8530ff86b841a7,3276   
+- commonmark-extensions-0.2.0.2@sha256:0fa1527b702eb0b95813ad2eac9c480d4735959a0712edf9f583b76eb88d51df,3178
+- commonmark-pandoc-0.2.0.1@sha256:529c6e2c6cabf61558b66a28123eafc1d90d3324be29819f59f024e430312c1f,1105
+- hakyll-4.13.4.1@sha256:199fa0f7e6e98a1a1858852f8f6a3be2e0f1e4becbe6b9a64db47dac0740ddf2,8867
 
-# Control whether we use the GHC we find on the path
-# system-ghc: true
-#
-# Require a specific version of stack, using version ranges
-# require-stack-version: -any # Default
-# require-stack-version: ">=1.7"
-#
-# Override the architecture used by stack, especially useful on Windows
-# arch: i386
-# arch: x86_64
-#
-# Extra directories used by stack for building
-# extra-include-dirs: [/path/to/dir]
-# extra-lib-dirs: [/path/to/dir]
-#
-# Allow a newer minor version of GHC than the snapshot specifies
-# compiler-check: newer-minor
+# For development
+- git: https://github.com/LaurentRDC/pandoc-include-code.git
+  commit: 13fb0ced5dd5669a300430fe89753f0c60f274dc
+- ghc-check-0.3.0.1@sha256:651d9b2b75a5cbdb3c942117801bfa566079bcaf20360e4d0959f9e575c30b39,1070
+  
+# Faster compilation.
+# See here: 
+#   https://downloads.haskell.org/ghc/latest/docs/html/users_guide/flags.html#miscellaneous-compiler-options
+# and here:
+#   https://ghc.gitlab.haskell.org/ghc/doc/users_guide/runtime_control.html
+# ghc-options:
+#   pandoc: -j "+RTS -A64m -RTS"
+#   pandoc-citeproc: -j "+RTS -A64m -RTS"
+#   $targets: -j "+RTS -A64m -RTS"
diff --git a/tests/Hakyll/Images/Common/Tests.hs b/tests/Hakyll/Images/Common/Tests.hs
--- a/tests/Hakyll/Images/Common/Tests.hs
+++ b/tests/Hakyll/Images/Common/Tests.hs
@@ -1,62 +1,69 @@
 {-# LANGUAGE OverloadedStrings #-}
+
 --------------------------------------------------------------------------------
 module Hakyll.Images.Common.Tests
-    ( tests
-    ) where
-
+  ( tests,
+  )
+where
 
 --------------------------------------------------------------------------------
-import           Test.Tasty             (TestTree, testGroup)
-import           Test.Tasty.HUnit       (Assertion, testCase, assertBool)
 
-
 --------------------------------------------------------------------------------
-import           Hakyll
+import Hakyll
 import qualified Hakyll.Core.Logger as L
-import           Hakyll.Core.Runtime
-import           Hakyll.Images
-
-import           System.Directory       (doesFileExist)
-import           System.FilePath        ((</>))
-import           Text.Printf            (printf)
+import Hakyll.Core.Runtime
+import Hakyll.Images
+import System.Directory (doesFileExist)
+import System.FilePath ((</>))
+import Test.Tasty (TestTree, testGroup)
+import Test.Tasty.HUnit (Assertion, assertBool, testCase)
+import Text.Printf (printf)
 
-fromAssertions :: String       -- ^ Name
-               -> [Assertion]  -- ^ Cases
-               -> [TestTree]   -- ^ Result tests
+fromAssertions ::
+  -- | Name
+  String ->
+  -- | Cases
+  [Assertion] ->
+  -- | Result tests
+  [TestTree]
 fromAssertions name =
-    zipWith testCase [printf "[%2d] %s" n name | n <- [1 :: Int ..]]
+  zipWith testCase [printf "[%2d] %s" n name | n <- [1 :: Int ..]]
 
 testConfiguration :: Configuration
-testConfiguration = defaultConfiguration
-    { destinationDirectory = "_testsite"
-    , storeDirectory       = "_teststore"
-    , tmpDirectory         = "_testtmp"
-    , providerDirectory    = "tests/data"
+testConfiguration =
+  defaultConfiguration
+    { destinationDirectory = "_testsite",
+      storeDirectory = "_teststore",
+      tmpDirectory = "_testtmp",
+      providerDirectory = "tests/data"
     }
 
 cleanTestEnv :: IO ()
 cleanTestEnv = do
-    removeDirectory $ destinationDirectory testConfiguration
-    removeDirectory $ storeDirectory testConfiguration
-    removeDirectory $ tmpDirectory testConfiguration
+  removeDirectory $ destinationDirectory testConfiguration
+  removeDirectory $ storeDirectory testConfiguration
+  removeDirectory $ tmpDirectory testConfiguration
 
 case1 :: Assertion
 case1 = do
-    logger <- L.new L.Error
-    _ <- run testConfiguration logger $ do
-        match "*.jpg" $ do
-            route idRoute
-            compile $ loadImage
-                >>= compressJpgCompiler 50
-    
-    _ <- assertBool "Image was not written" <$> 
-        (doesFileExist $ destinationDirectory testConfiguration </> "piccolo.jpg")
+  logger <- L.new L.Error
+  _ <- run testConfiguration logger $ do
+    match "*.jpg" $ do
+      route idRoute
+      compile $
+        loadImage
+          >>= compressJpgCompiler 50
 
-    cleanTestEnv
+  _ <-
+    assertBool "Image was not written"
+      <$> (doesFileExist $ destinationDirectory testConfiguration </> "piccolo.jpg")
 
+  cleanTestEnv
 
 --------------------------------------------------------------------------------
 tests :: TestTree
-tests = testGroup "Hakyll.Images.Common.Tests" $ concat
-   [ fromAssertions "run" [ case1 ]
-   ]
+tests =
+  testGroup "Hakyll.Images.Common.Tests" $
+    concat
+      [ fromAssertions "run" [case1]
+      ]
diff --git a/tests/Hakyll/Images/CompressJpg/Tests.hs b/tests/Hakyll/Images/CompressJpg/Tests.hs
--- a/tests/Hakyll/Images/CompressJpg/Tests.hs
+++ b/tests/Hakyll/Images/CompressJpg/Tests.hs
@@ -1,83 +1,85 @@
 --------------------------------------------------------------------------------
 module Hakyll.Images.CompressJpg.Tests
-    ( tests
-    ) where
-
+  ( tests,
+  )
+where
 
 --------------------------------------------------------------------------------
-import           Test.Tasty             (TestTree, testGroup)
-import           Test.Tasty.HUnit       (Assertion, assertBool, assertFailure, testCase)
 
-
 --------------------------------------------------------------------------------
-import           Hakyll.Images.CompressJpg
-import           Hakyll.Images.Common
-import qualified Data.ByteString        as B
 
-import           Control.Exception      (ErrorCall, catch, evaluate)
-
-import           Text.Printf            (printf)
-
+import Control.Exception (ErrorCall, catch, evaluate)
+import qualified Data.ByteString as B
+import Hakyll.Images.Common
+import Hakyll.Images.CompressJpg
+import Test.Tasty (TestTree, testGroup)
+import Test.Tasty.HUnit (Assertion, assertBool, assertFailure, testCase)
+import Text.Printf (printf)
 
-testJpg :: IO Image 
+testJpg :: IO Image
 testJpg = Image Jpeg <$> (B.readFile "tests/data/piccolo.jpg")
 
-fromAssertions :: String       -- ^ Name
-               -> [Assertion]  -- ^ Cases
-               -> [TestTree]   -- ^ Result tests
+fromAssertions ::
+  -- | Name
+  String ->
+  -- | Cases
+  [Assertion] ->
+  -- | Result tests
+  [TestTree]
 fromAssertions name =
-    zipWith testCase [printf "[%2d] %s" n name | n <- [1 :: Int ..]]
+  zipWith testCase [printf "[%2d] %s" n name | n <- [1 :: Int ..]]
 
 -- Test that the standard Image compressed to quality 25/100 is smaller
 -- than the initial image
 testCompressionFromImage :: Assertion
 testCompressionFromImage = do
-    im <- testJpg
-    let initialSize = (B.length . image) im
-        finalSize   = (B.length . image . compressJpg 25) im
-    
-    assertBool "Image was not compressed" (initialSize > finalSize)
+  im <- testJpg
+  let initialSize = (B.length . image) im
+      finalSize = (B.length . image . compressJpg 25) im
 
+  assertBool "Image was not compressed" (initialSize > finalSize)
+
 -- Test that specifying a JPG encoding below 0 will fail
 testJpgEncodingOutOfLowerBound :: Assertion
 testJpgEncodingOutOfLowerBound = do
-    im <- testJpg
-    -- Catching exceptions is an idea from here:
-    -- https://stackoverflow.com/questions/46330592/is-it-possible-to-assert-an-error-case-in-hunit
-    -- Since compressJpg is a "pure" function, we need to evaluate it in an IO context
-    -- to catch errors.
-    errored <- catch (evaluate (compressJpg (-10) im) >> pure False) handler
-    if errored then
-        pure ()
-    else 
-        assertFailure "did not catch expected error"
-    where
-        handler :: ErrorCall -> IO Bool
-        handler _ = pure True
+  im <- testJpg
+  -- Catching exceptions is an idea from here:
+  -- https://stackoverflow.com/questions/46330592/is-it-possible-to-assert-an-error-case-in-hunit
+  -- Since compressJpg is a "pure" function, we need to evaluate it in an IO context
+  -- to catch errors.
+  errored <- catch (evaluate (compressJpg (-10) im) >> pure False) handler
+  if errored
+    then pure ()
+    else assertFailure "did not catch expected error"
+  where
+    handler :: ErrorCall -> IO Bool
+    handler _ = pure True
 
 -- Test that specifying a JPG encoding above 100 will fail
 testJpgEncodingOutOfUpperBound :: Assertion
 testJpgEncodingOutOfUpperBound = do
-    im <- testJpg
-    -- Catching exceptions is an idea from here:
-    -- https://stackoverflow.com/questions/46330592/is-it-possible-to-assert-an-error-case-in-hunit
-    -- Since compressJpg is a "pure" function, we need to evaluate it in an IO context
-    -- to catch errors.
-    errored <- catch (evaluate (compressJpg 111 im) >> pure False) handler
-    if errored then
-        pure ()
-    else 
-        assertFailure "did not catch expected error"
-    where
-        handler :: ErrorCall -> IO Bool
-        handler _ = pure True
+  im <- testJpg
+  -- Catching exceptions is an idea from here:
+  -- https://stackoverflow.com/questions/46330592/is-it-possible-to-assert-an-error-case-in-hunit
+  -- Since compressJpg is a "pure" function, we need to evaluate it in an IO context
+  -- to catch errors.
+  errored <- catch (evaluate (compressJpg 111 im) >> pure False) handler
+  if errored
+    then pure ()
+    else assertFailure "did not catch expected error"
+  where
+    handler :: ErrorCall -> IO Bool
+    handler _ = pure True
 
 --------------------------------------------------------------------------------
 tests :: TestTree
-tests = testGroup "Hakyll.Images.CompressJpg.Tests" $ concat
-   [ fromAssertions "compressJpg" 
-        [ testCompressionFromImage 
-        , testJpgEncodingOutOfLowerBound
-        , testJpgEncodingOutOfUpperBound
-        ] 
-    ]
+tests =
+  testGroup "Hakyll.Images.CompressJpg.Tests" $
+    concat
+      [ fromAssertions
+          "compressJpg"
+          [ testCompressionFromImage,
+            testJpgEncodingOutOfLowerBound,
+            testJpgEncodingOutOfUpperBound
+          ]
+      ]
diff --git a/tests/Hakyll/Images/Metadata/Tests.hs b/tests/Hakyll/Images/Metadata/Tests.hs
--- a/tests/Hakyll/Images/Metadata/Tests.hs
+++ b/tests/Hakyll/Images/Metadata/Tests.hs
@@ -1,47 +1,51 @@
 {-# LANGUAGE OverloadedStrings #-}
+
 --------------------------------------------------------------------------------
 module Hakyll.Images.Metadata.Tests
-    ( tests
-    ) where
-
+  ( tests,
+  )
+where
 
 --------------------------------------------------------------------------------
-import           Test.Tasty             (TestTree, testGroup)
-import           Test.Tasty.HUnit       (Assertion, assertBool, testCase)
 
-
 --------------------------------------------------------------------------------
-import qualified Data.ByteString        as B
-import           Data.Maybe             (fromMaybe)
-import           Hakyll.Images
-import           Hakyll.Images.Common
-
+import qualified Data.ByteString as B
+import Data.Maybe (fromMaybe)
+import Hakyll.Images
+import Hakyll.Images.Common
 import qualified Hakyll.Images.Metadata as M
-
-import           Text.Printf            (printf)
+import Test.Tasty (TestTree, testGroup)
+import Test.Tasty.HUnit (Assertion, assertBool, testCase)
+import Text.Printf (printf)
 
-fromAssertions :: String       -- ^ Name
-               -> [Assertion]  -- ^ Cases
-               -> [TestTree]   -- ^ Result tests
+fromAssertions ::
+  -- | Name
+  String ->
+  -- | Cases
+  [Assertion] ->
+  -- | Result tests
+  [TestTree]
 fromAssertions name =
-    zipWith testCase [printf "[%2d] %s" n name | n <- [1 :: Int ..]]
+  zipWith testCase [printf "[%2d] %s" n name | n <- [1 :: Int ..]]
 
-testJpg :: IO Image 
+testJpg :: IO Image
 testJpg = Image Jpeg <$> (B.readFile "tests/data/piccolo.jpg")
 
 testMetadata :: Assertion
 testMetadata = do
-    im <- testJpg
-    let meta = metadata im
-        height = fromMaybe 0 (M.lookup M.Height meta)
-        width  = fromMaybe 0 (M.lookup M.Width meta)
-    
-    -- The following values of (width, height) = (1170, 647) are 
-    -- specific to the "piccolo.jpg" image
-    assertBool "Metadata was not decoded properly" (height == 647)
-    assertBool "Metadata was not decoded properly" (width == 1170)
+  im <- testJpg
+  let meta = metadata im
+      height = fromMaybe 0 (M.lookup M.Height meta)
+      width = fromMaybe 0 (M.lookup M.Width meta)
 
+  -- The following values of (width, height) = (1170, 647) are
+  -- specific to the "piccolo.jpg" image
+  assertBool "Metadata was not decoded properly" (height == 647)
+  assertBool "Metadata was not decoded properly" (width == 1170)
+
 tests :: TestTree
-tests = testGroup "Hakyll.Images.Metadata.Tests" $ concat
-   [ fromAssertions "metadata" [ testMetadata ]
-   ]
+tests =
+  testGroup "Hakyll.Images.Metadata.Tests" $
+    concat
+      [ fromAssertions "metadata" [testMetadata]
+      ]
diff --git a/tests/Hakyll/Images/Resize/Tests.hs b/tests/Hakyll/Images/Resize/Tests.hs
--- a/tests/Hakyll/Images/Resize/Tests.hs
+++ b/tests/Hakyll/Images/Resize/Tests.hs
@@ -1,98 +1,106 @@
 --------------------------------------------------------------------------------
 module Hakyll.Images.Resize.Tests
-    ( tests
-    ) where
-
+  ( tests,
+  )
+where
 
 --------------------------------------------------------------------------------
-import           Test.Tasty             (TestTree, testGroup)
-import           Test.Tasty.HUnit       (Assertion, assertBool, assertEqual, testCase)
-import           Test.HUnit.Approx      (assertApproxEqual)
 
-
 --------------------------------------------------------------------------------
-import           Hakyll.Images
-import qualified Data.ByteString        as B
-import           Data.Ratio             ((%))
 
-import           Codec.Picture
-
-import           Text.Printf            (printf)
+import Codec.Picture
+import qualified Data.ByteString as B
+import Data.Ratio ((%))
+import Hakyll.Images
+import Test.HUnit.Approx (assertApproxEqual)
+import Test.Tasty (TestTree, testGroup)
+import Test.Tasty.HUnit (Assertion, assertBool, assertEqual, testCase)
+import Text.Printf (printf)
 
 -- Original test image "piccolo.jpg" has shape 1170 x 647px
 testJpg :: IO DynamicImage
 testJpg = do
-    img <- decodeJpeg <$> B.readFile "tests/data/piccolo.jpg"
-    case img of
-        Left _ -> error "Could not decode test picture piccolo.jpg"
-        Right im -> return im
+  img <- decodeJpeg <$> B.readFile "tests/data/piccolo.jpg"
+  case img of
+    Left _ -> error "Could not decode test picture piccolo.jpg"
+    Right im -> return im
 
-fromAssertions :: String       -- ^ Name
-               -> [Assertion]  -- ^ Cases
-               -> [TestTree]   -- ^ Result tests
+fromAssertions ::
+  -- | Name
+  String ->
+  -- | Cases
+  [Assertion] ->
+  -- | Result tests
+  [TestTree]
 fromAssertions name =
-    zipWith testCase [printf "[%2d] %s" n name | n <- [1 :: Int ..]]
+  zipWith testCase [printf "[%2d] %s" n name | n <- [1 :: Int ..]]
 
 -- Test that the rescaled image is of the appropriate scale
 testResize :: Assertion
 testResize = do
-    image <- testJpg
-    let scaledImage = resize 48 64 image
-        converted = convertRGBA8 scaledImage
-        (width, height) = ( imageWidth converted
-                          , imageHeight converted
-                          )
-    assertEqual "Image width was not resized properly" width 48 
-    assertEqual "Image height was not resized properly" height 64
+  image <- testJpg
+  let scaledImage = resize 48 64 image
+      converted = convertRGBA8 scaledImage
+      (width, height) =
+        ( imageWidth converted,
+          imageHeight converted
+        )
+  assertEqual "Image width was not resized properly" width 48
+  assertEqual "Image height was not resized properly" height 64
 
 -- Test that the rescaled image fits in the appropriate box
 testScale :: Assertion
 testScale = do
-    image <- testJpg
-    let scaledImage = scale 600 400 image
-        converted = convertRGBA8 scaledImage
-        (width, height) = ( imageWidth converted
-                          , imageHeight converted
-                          )
-    assertBool "Image width was not scaled properly" (width <= 600)
-    assertBool "Image height was not scaled properly" (height<= 400)
-    assertBool "Image overall was not scaled properly" (width == 600 || height == 400)
+  image <- testJpg
+  let scaledImage = scale 600 400 image
+      converted = convertRGBA8 scaledImage
+      (width, height) =
+        ( imageWidth converted,
+          imageHeight converted
+        )
+  assertBool "Image width was not scaled properly" (width <= 600)
+  assertBool "Image height was not scaled properly" (height <= 400)
+  assertBool "Image overall was not scaled properly" (width == 600 || height == 400)
 
 -- Test that the images that already fit in dimensions are not scaled
 testEnsureFit :: Assertion
 testEnsureFit = do
-    image <- testJpg
-    let (originalWidth, originalHeight) = (imageWidth . convertRGBA8 $ image, imageHeight . convertRGBA8 $ image)
-        scaledImage = ensureFit 2000 2000 image
-        converted = convertRGBA8 scaledImage
-        (width, height) = ( imageWidth converted
-                          , imageHeight converted
-                          )
-    assertEqual "Image width was not scaled properly" width originalWidth
-    assertEqual "Image height was not scaled property" height originalHeight
-
+  image <- testJpg
+  let (originalWidth, originalHeight) = (imageWidth . convertRGBA8 $ image, imageHeight . convertRGBA8 $ image)
+      scaledImage = ensureFit 2000 2000 image
+      converted = convertRGBA8 scaledImage
+      (width, height) =
+        ( imageWidth converted,
+          imageHeight converted
+        )
+  assertEqual "Image width was not scaled properly" width originalWidth
+  assertEqual "Image height was not scaled property" height originalHeight
 
 -- Test that the rescaled image has the same aspect ratio
 testScalePreservesAspectRatio :: Assertion
 testScalePreservesAspectRatio = do
-    image <- testJpg
+  image <- testJpg
 
-    let initialAspectRatio = (imageWidth $ convertRGBA8 image) % (imageHeight $ convertRGBA8 image)
-        scaledImage = scale 600 400 image
-        finalAspectRatio = (imageWidth $ convertRGBA8 scaledImage) % (imageHeight $ convertRGBA8 scaledImage)
-    
-    assertApproxEqual "Aspect ratio was not preserved" 0.02 initialAspectRatio finalAspectRatio
-        
+  let initialAspectRatio = (imageWidth $ convertRGBA8 image) % (imageHeight $ convertRGBA8 image)
+      scaledImage = scale 600 400 image
+      finalAspectRatio = (imageWidth $ convertRGBA8 scaledImage) % (imageHeight $ convertRGBA8 scaledImage)
 
+  assertApproxEqual "Aspect ratio was not preserved" 0.02 initialAspectRatio finalAspectRatio
+
 --------------------------------------------------------------------------------
 tests :: TestTree
-tests = testGroup "Hakyll.Images.Resize.Tests" $ concat
-   [ fromAssertions "rescale" 
-        [ testScale
-        , testScalePreservesAspectRatio
-        ]
-    , fromAssertions "ensureFit"
-        [ testEnsureFit ] 
-    , fromAssertions "resize" 
-        [ testResize ]
-    ]
+tests =
+  testGroup "Hakyll.Images.Resize.Tests" $
+    concat
+      [ fromAssertions
+          "rescale"
+          [ testScale,
+            testScalePreservesAspectRatio
+          ],
+        fromAssertions
+          "ensureFit"
+          [testEnsureFit],
+        fromAssertions
+          "resize"
+          [testResize]
+      ]
diff --git a/tests/TestSuite.hs b/tests/TestSuite.hs
--- a/tests/TestSuite.hs
+++ b/tests/TestSuite.hs
@@ -1,26 +1,27 @@
 --------------------------------------------------------------------------------
 module Main
-    ( main
-    ) where
-
+  ( main,
+  )
+where
 
 --------------------------------------------------------------------------------
-import           Test.Tasty                           (defaultMain, testGroup)
 
-
 --------------------------------------------------------------------------------
 
 import qualified Hakyll.Images.Common.Tests
 import qualified Hakyll.Images.CompressJpg.Tests
-import qualified Hakyll.Images.Resize.Tests
 import qualified Hakyll.Images.Metadata.Tests
-
+import qualified Hakyll.Images.Resize.Tests
+import Test.Tasty (defaultMain, testGroup)
 
 --------------------------------------------------------------------------------
 main :: IO ()
-main = defaultMain $ testGroup "Hakyll"
-    [ Hakyll.Images.Common.Tests.tests
-    , Hakyll.Images.CompressJpg.Tests.tests
-    , Hakyll.Images.Resize.Tests.tests 
-    , Hakyll.Images.Metadata.Tests.tests
-    ]
+main =
+  defaultMain $
+    testGroup
+      "Hakyll"
+      [ Hakyll.Images.Common.Tests.tests,
+        Hakyll.Images.CompressJpg.Tests.tests,
+        Hakyll.Images.Resize.Tests.tests,
+        Hakyll.Images.Metadata.Tests.tests
+      ]
