From e324f3b776e24a441e2b436da95629f0eadaed3f Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 27 Dec 2019 15:40:50 +0100 Subject: compiler: make extension case insensitive --- compiler/src/Processors.hs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/compiler/src/Processors.hs b/compiler/src/Processors.hs index c097db7..7bf1e36 100644 --- a/compiler/src/Processors.hs +++ b/compiler/src/Processors.hs @@ -35,6 +35,7 @@ module Processors import Control.Exception (throwIO) import Data.Function ((&)) import Data.Ratio ((%)) +import Data.Char (toLower) import GHC.Generics (Generic) import Data.Aeson (FromJSON) @@ -56,14 +57,16 @@ data Format = | Other formatFromExt :: String -> Format -formatFromExt ".bmp" = Bmp -formatFromExt ".jpg" = Jpg -formatFromExt ".jpeg" = Jpg -formatFromExt ".png" = Png -formatFromExt ".tiff" = Tiff -formatFromExt ".hdr" = Hdr -formatFromExt ".gif" = Gif -formatFromExt _ = Other +formatFromExt = aux . (map toLower) + where + aux ".bmp" = Bmp + aux ".jpg" = Jpg + aux ".jpeg" = Jpg + aux ".png" = Png + aux ".tiff" = Tiff + aux ".hdr" = Hdr + aux ".gif" = Gif + aux _ = Other data Resolution = Resolution { width :: Int -- cgit v1.2.3