hakyll-images 0.1.0 → 0.2.0
raw patch · 13 files changed
+434/−298 lines, 13 filessetup-changed
Files
- CHANGELOG.md +16/−12
- LICENSE.md +10/−10
- README.md +91/−87
- Setup.hs +7/−7
- hakyll-images.cabal +5/−3
- library/Hakyll/Images.hs +50/−3
- library/Hakyll/Images/Common.hs +69/−0
- library/Hakyll/Images/CompressJpg.hs +20/−14
- library/Hakyll/Images/Resize.hs +44/−40
- package.yaml +55/−55
- stack.yaml +64/−64
- tests/Hakyll/Images/CompressJpg/Tests.hs +2/−2
- tests/Hakyll/Images/Resize/Tests.hs +1/−1
CHANGELOG.md view
@@ -1,12 +1,16 @@-# Change log--Release 0.1.0 (Work-in-progress)-----------------------------------* added resizeImageCompiler to resize images to a specific shape;-* added scaleImageCompiler to scale images while keeping aspect ratio.--Release 0.0.1----------------* Added compressJpgCompiler to compress JPEGs.+# Change log + +Release 0.1.1 + +* Exposed `resizeImageCompiler` and `scaleImageCompiler` to the base `Hakyll.Images` module + +Release 0.1.0 +------------- + +* added `resizeImageCompiler` to resize images to a specific shape; +* added `scaleImageCompiler` to scale images while keeping aspect ratio. + +Release 0.0.1 +------------- + +* Added compressJpgCompiler to compress JPEGs.
LICENSE.md view
@@ -1,11 +1,11 @@-Copyright 2018 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:--1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.--2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.--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.-+Copyright 2019 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: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +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.
README.md view
@@ -1,88 +1,92 @@-# hakyll-images--[](http://hackage.haskell.org/package/hakyll-images) [](https://ci.appveyor.com/project/LaurentRDC/hakyll-images)--## A Haskell package containing utilities to deal with images in the context of Hakyll--[Hakyll](https://hackage.haskell.org/package/hakyll) is a static website compiler library. As one of the benefits of static websites is their small size, this repository aims at providing utilities to work with images in the context of Hakyll. Example usage includes:--* Re-encoding Jpeg images at a lower quality to make them much smaller;-* Re-sizing images to fit within a certain shape;--## Usage--`hakyll-images` is meant to be integrated within a Hakyll program. Here are some examples within a Hakyll program:--```haskell-import Hakyll-import Hakyll.Images ( compressJpgCompiler- , resizeImageCompiler- , scaleImageCompiler- )--(...)--hakyll $ do-- -- Compress all source Jpegs to a Jpeg quality of 50 (maximum of 100)- match "images/**.jpg" $ do- route idRoute- compile (compressJpgCompiler 50)-- -- Resize all profile pictures to 64x48- -- Aspect ratio might be mangled- match "profiles/**.jpg" $ do- route idRoute- compile (resizeImageCompiler 64 48)-- -- Scale images to fit within a 600x400 box- -- Aspect ratio will be preserved- match "images/**.png" $ do- route idRoute- compile (scaleImageCompiler 600 400)-- (...)-```--Take a look at the [documentation](hackage.haskell.org/package/hakyll-images) for more usage examples.--If you would like a feature added, consider creating [an issue on Github](https://github.com/LaurentRDC/hakyll-images/issues/)--## Installation--### From Hackage--`hakyll-images` is available on [Hackage](https://hackage.haskell.org). Using the [`cabal-install`](https://www.haskell.org/cabal/) tool:--```bash-cabal update-cabal install hakyll-images-```--### From source--Building from source can be done using [`stack`](https://docs.haskellstack.org/en/stable/README/) or [`cabal`](https://www.haskell.org/cabal/):--```bash-git clone github.com/LaurentRDC/hakyll-images.git-cd hakyll-images-stack install # Alternatively, `cabal install`-```--## Documentation--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-+# hakyll-images + +[](http://hackage.haskell.org/package/hakyll-images) [](https://ci.appveyor.com/project/LaurentRDC/hakyll-images) + +## A Haskell package containing utilities to deal with images in the context of Hakyll + +[Hakyll](https://hackage.haskell.org/package/hakyll) is a static website compiler library. As one of the benefits of static websites is their small size, this repository aims at providing utilities to work with images in the context of Hakyll. Example usage includes: + +* Re-encoding Jpeg images at a lower quality to make them much smaller; +* Re-sizing images to fit within a certain shape; + +## Usage + +`hakyll-images` is meant to be integrated within a Hakyll program. Here are some examples within a Hakyll program: + +```haskell +import Hakyll +import Hakyll.Images ( compressJpgCompiler + , resizeImageCompiler + , scaleImageCompiler + ) + +(...) + +hakyll $ do + + -- Compress all source Jpegs to a Jpeg quality of 50 (maximum of 100) + match "images/**.jpg" $ do + route idRoute + compile $ loadImage + >>= compressJpgCompiler 50 + + -- Resize all profile pictures to 64x48 + -- Aspect ratio might be mangled + match "profiles/**.jpg" $ do + route idRoute + compile $ loadImage + >>= resizeImageCompiler 64 48 + >>= compressJpg 50 + + -- Scale images to fit within a 600x400 box + -- Aspect ratio will be preserved + match "images/**.png" $ do + route idRoute + compile $ loadImage + >>= scaleImageCompiler 600 400 + + (...) +``` + +Take a look at the [documentation](hackage.haskell.org/package/hakyll-images) for more usage examples. + +If you would like a feature added, consider creating [an issue on Github](https://github.com/LaurentRDC/hakyll-images/issues/) + +## Installation + +### From Hackage + +`hakyll-images` is available on [Hackage](https://hackage.haskell.org). Using the [`cabal-install`](https://www.haskell.org/cabal/) tool: + +```bash +cabal update +cabal install hakyll-images +``` + +### From source + +Building from source can be done using [`stack`](https://docs.haskellstack.org/en/stable/README/) or [`cabal`](https://www.haskell.org/cabal/): + +```bash +git clone github.com/LaurentRDC/hakyll-images.git +cd hakyll-images +stack install # Alternatively, `cabal install` +``` + +## Documentation + +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)
Setup.hs view
@@ -1,7 +1,7 @@--- This script is used to build and install your package. Typically you don't--- need to change it. The Cabal documentation has more information about this--- file: <https://www.haskell.org/cabal/users-guide/installing-packages.html>.-import qualified Distribution.Simple--main :: IO ()-main = Distribution.Simple.defaultMain+-- This script is used to build and install your package. Typically you don't +-- need to change it. The Cabal documentation has more information about this +-- file: <https://www.haskell.org/cabal/users-guide/installing-packages.html>. +import qualified Distribution.Simple + +main :: IO () +main = Distribution.Simple.defaultMain
hakyll-images.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.30.0.+-- This file has been generated from package.yaml by hpack version 0.31.1. -- -- see: https://github.com/sol/hpack ----- hash: 947315fcd96241760b35b112def30618422d1da5a3b0024b6d183d8d0075da1d+-- hash: 441476f2acbede0dd71705047640f3afd182078fd9bfb34144d805fe3e4ba727 name: hakyll-images-version: 0.1.0+version: 0.2.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@@ -37,6 +37,7 @@ Hakyll.Images.CompressJpg Hakyll.Images.Resize other-modules:+ Hakyll.Images.Common Paths_hakyll_images hs-source-dirs: library@@ -56,6 +57,7 @@ Hakyll.Images.CompressJpg.Tests Hakyll.Images.Resize.Tests Hakyll.Images+ Hakyll.Images.Common Hakyll.Images.CompressJpg Hakyll.Images.Resize Paths_hakyll_images
library/Hakyll/Images.hs view
@@ -2,22 +2,69 @@ {-| Module : Hakyll.Images Description : Hakyll utilities for image files -Copyright : (c) Laurent P René de Cotret, 2018 +Copyright : (c) Laurent P René de Cotret, 2019 License : BSD3 Maintainer : laurent.decotret@outlook.com Stability : stable 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 ( 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 ( 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 -- Jpg compression - JpgQuality + , JpgQuality , compressJpg , compressJpgCompiler -- Image scaling , Width, Height , resize + , resizeImageCompiler , scale + , scaleImageCompiler ) where import Hakyll.Images.CompressJpg -import Hakyll.Images.Resize+import Hakyll.Images.Resize +import Hakyll.Images.Common
+ library/Hakyll/Images/Common.hs view
@@ -0,0 +1,69 @@+ +{-| +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 : stable +Portability : portable +-} + +module Hakyll.Images.Common ( Image + , ImageFormat + , fromExt + , loadImage + , encode + ) where + +import Prelude hiding (readFile) + +import Codec.Picture.Types (DynamicImage) +import Codec.Picture.Saving + +import Data.ByteString.Lazy (toStrict) +import Data.ByteString (ByteString) + +import Hakyll.Core.Compiler (Compiler, getResourceLBS) +import Hakyll.Core.Item (Item(..)) + + +type Image = ByteString + +-- Supported (i.e. encodable) image formats +data ImageFormat + = Jpeg + | Png + | Bitmap + | Tiff + +-- | Load an image from a file. +-- This function can be combined with other compilers. +-- +-- @ +-- match "*.jpg" $ do +-- route idRoute +-- compile $ loadImage +-- >>= compressJpgCompiler 50 +-- @ +loadImage :: Compiler Image +loadImage = (toStrict . itemBody) <$> getResourceLBS + +-- | Translation between file extensions and image formats. +-- It is important to keep track of image formats because Hakyll +-- compilers provides raw bytestrings and filenames +fromExt :: String -> ImageFormat +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 = toStrict . imageToJpg 100 +encode Png = toStrict . imageToPng +encode Bitmap = toStrict . imageToBitmap +encode Tiff = toStrict . imageToTiff
library/Hakyll/Images/CompressJpg.hs view
@@ -2,7 +2,7 @@ {-| Module : Hakyll.Images.CompressJpg Description : Hakyll compiler to compress Jpeg images -Copyright : (c) Laurent P René de Cotret, 2018 +Copyright : (c) Laurent P René de Cotret, 2019 License : BSD3 Maintainer : laurent.decotret@outlook.com Stability : stable @@ -18,15 +18,13 @@ import Hakyll import Hakyll.Images (compressJpgCompiler) - (... omitted ...) - hakyll $ do - (... omitted ...) -- Compress all source Jpegs to a Jpeg quality of 50 match "images/**.jpg" $ do route idRoute - compile (compressJpgCompiler 50) + compile $ loadImage + >>= compressJpgCompiler 50 (... omitted ...) @ @@ -37,15 +35,17 @@ , compressJpg ) where -import Data.ByteString.Lazy (ByteString, toStrict) +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, getResourceLBS) +import Hakyll.Core.Item (Item(..)) +import Hakyll.Core.Compiler (Compiler) +import Hakyll.Images.Common (Image) + -- | Jpeg encoding quality, from 0 (lower quality) to 100 (best quality). type JpgQuality = Int @@ -54,19 +54,25 @@ -- 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 -- encoding quality is out-of-bounds -compressJpg :: JpgQuality -> ByteString -> ByteString -compressJpg quality src = case im of +compressJpg :: JpgQuality -> Image -> Image +compressJpg quality src = case decodeJpeg 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 imageToJpg quality dynImage + else toStrict $ imageToJpg quality dynImage -- The function `decodeJpeg` requires strict ByteString -- However, `imageToJpg` requires Lazy Bytestrings - where im = (decodeJpeg . toStrict) src -- | Compiler that compresses a JPG image 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. -compressJpgCompiler :: JpgQuality -> Compiler (Item ByteString) -compressJpgCompiler quality = fmap (compressJpg quality) <$> getResourceLBS+-- +-- @ +-- match "*.jpg" $ do +-- route idRoute +-- compile $ loadImage +-- >>= compressJpgCompiler 50 +-- @ +compressJpgCompiler :: JpgQuality -> Item Image -> Compiler (Item Image) +compressJpgCompiler quality item = return $ compressJpg quality <$> item
library/Hakyll/Images/Resize.hs view
@@ -2,7 +2,7 @@ {-| Module : Hakyll.Images.Resize Description : Hakyll compiler to resize images -Copyright : (c) Laurent P René de Cotret, 2018 +Copyright : (c) Laurent P René de Cotret, 2019 License : BSD3 Maintainer : laurent.decotret@outlook.com Stability : stable @@ -16,22 +16,23 @@ @ import Hakyll - import Hakyll.Images (resizeImageCompiler, scaleImageCompiler) - - (... omitted ...) + import Hakyll.Images ( resizeImageCompiler + , scaleImageCompiler + ) hakyll $ do - (... omitted ...) - -- Resize all profile pictures to 64x48 - match "profiles/**.jpg" $ do + -- Resize all profile pictures with .png extensions to 64x48 + match "profiles/**.png" $ do route idRoute - compile (resizeImageCompiler 64 48) + compile $ loadImage + >>= resizeImageCompiler 64 48 -- Scale images to fit within a 600x400 box - match "images/**.jpg" $ do + match "images/**" $ do route idRoute - compile (scaleImageCompiler 600 400) + compile $ loadImage + >>= scaleImageCompiler 600 400 (... omitted ...) @ @@ -45,26 +46,25 @@ ) where import Codec.Picture (convertRGBA8, decodeImage) -import Codec.Picture.Types -import Codec.Picture.Saving +import Codec.Picture.Types (DynamicImage(..), imageHeight, imageWidth) import Codec.Picture.Extra (scaleBilinear) -import Data.ByteString.Lazy (ByteString, toStrict) +import Data.ByteString (ByteString) import Data.Ratio ((%)) -import Hakyll.Core.Item (Item(..), itemBody) -import Hakyll.Core.Compiler (Compiler, getResourceLBS, getUnderlyingExtension) +import Hakyll.Core.Identifier (toFilePath) +import Hakyll.Core.Item (Item(..)) +import Hakyll.Core.Compiler (Compiler) +import Hakyll.Images.Common (Image, encode, fromExt) + type Width = Int type Height = Int --- | Encode a dynamic image to a bytestring based on the file extension -encode :: String -> DynamicImage -> ByteString -encode ".jpg" = imageToJpg 100 -encode ".png" = imageToPng -encode ".bmp" = imageToBitmap -encode ".tiff" = imageToTiff -encode fmt = error $ "Unsupported format " <> fmt +decodeImage' :: ByteString -> DynamicImage +decodeImage' im = case decodeImage im of + Left msg -> error msg + Right image -> image -- | Resize an image to specified width and height using the bilinear transform. -- The aspect ratio may not be respected. @@ -76,15 +76,17 @@ -- | Compiler that resizes images to a specific dimensions. Aspect ratio -- may not be preserved. -resizeImageCompiler :: Width -> Height -> Compiler (Item ByteString) -resizeImageCompiler w h = do - ext <- getUnderlyingExtension - imageItem <- fmap (decodeImage . toStrict) <$> getResourceLBS - case itemBody imageItem of - Left msg -> error msg - Right image -> do - let resized = resize w h image - return $ Item (itemIdentifier imageItem) (encode ext resized) +-- +-- @ +-- match "*.png" $ do +-- route idRoute +-- compile $ loadImage +-- >>= resizeImageCompiler 48 64 +-- @ +resizeImageCompiler :: Width -> Height -> Item Image -> Compiler (Item Image) +resizeImageCompiler w h item = do + let ext = (fromExt . toFilePath . itemIdentifier) item + return $ (encode ext . resize w h . decodeImage') <$> item -- | Scale an image to a size that will fit in the specified width and height, -- while preserving aspect ratio. @@ -104,12 +106,14 @@ -- | Compiler that rescales images to fit within dimensions. Aspect ratio -- will be preserved. -scaleImageCompiler :: Width -> Height -> Compiler (Item ByteString) -scaleImageCompiler w h = do - ext <- getUnderlyingExtension - imageItem <- fmap (decodeImage . toStrict) <$> getResourceLBS - case itemBody imageItem of - Left msg -> error msg - Right image -> do - let rescaled = scale w h image - return $ Item (itemIdentifier imageItem) (encode ext rescaled)+-- +-- @ +-- match "*.tiff" $ do +-- route idRoute +-- compile $ loadImage +-- >>= scaleImageCompiler 48 64 +-- @ +scaleImageCompiler :: Width -> Height -> Item Image -> Compiler (Item Image) +scaleImageCompiler w h item = do + let ext = (fromExt . toFilePath . itemIdentifier) item + return $ (encode ext . scale w h . decodeImage') <$> item
package.yaml view
@@ -1,55 +1,55 @@-name: hakyll-images-version: '0.1.0'-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- - 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 && < 1.2- - tasty-hunit >= 0.9 && < 0.11- - HUnit-approx >= 1.0.0.0- # Base hakyll-images dependencies- - base >= 4.8 && < 5- - bytestring >= 0.9 && < 0.11- - hakyll > 4- - JuicyPixels >= 3- - JuicyPixels-extra > 0.3+name: hakyll-images +version: '0.2.0' +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 + - 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 && < 1.2 + - tasty-hunit >= 0.9 && < 0.11 + - HUnit-approx >= 1.0.0.0 + # Base hakyll-images dependencies + - base >= 4.8 && < 5 + - bytestring >= 0.9 && < 0.11 + - hakyll > 4 + - JuicyPixels >= 3 + - JuicyPixels-extra > 0.3
stack.yaml view
@@ -1,65 +1,65 @@-# 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.22--# 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: {}--# Extra package databases containing global packages-# extra-package-dbs: []--# 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+# 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.24 + +# 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: {} + +# Extra package databases containing global packages +# extra-package-dbs: [] + +# 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
tests/Hakyll/Images/CompressJpg/Tests.hs view
@@ -11,7 +11,7 @@ -------------------------------------------------------------------------------- import Hakyll.Images.CompressJpg -import qualified Data.ByteString.Lazy as B +import qualified Data.ByteString as B import Control.Exception (ErrorCall, catch, evaluate) @@ -73,7 +73,7 @@ -------------------------------------------------------------------------------- tests :: TestTree -tests = testGroup "Hakyll.Web.CompressJpg.Tests" $ concat +tests = testGroup "Hakyll.Images.CompressJpg.Tests" $ concat [ fromAssertions "compressJpg" [ testCompressionFromImage , testJpgEncodingOutOfLowerBound
tests/Hakyll/Images/Resize/Tests.hs view
@@ -71,7 +71,7 @@ -------------------------------------------------------------------------------- tests :: TestTree -tests = testGroup "Hakyll.Web.Resize.Tests" $ concat +tests = testGroup "Hakyll.Images.Resize.Tests" $ concat [ fromAssertions "rescale" [ testResize , testScale