aboutsummaryrefslogtreecommitdiff
path: root/compiler/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src')
-rw-r--r--compiler/src/Processors.hs19
1 files 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
35import Control.Exception (throwIO) 35import Control.Exception (throwIO)
36import Data.Function ((&)) 36import Data.Function ((&))
37import Data.Ratio ((%)) 37import Data.Ratio ((%))
38import Data.Char (toLower)
38 39
39import GHC.Generics (Generic) 40import GHC.Generics (Generic)
40import Data.Aeson (FromJSON) 41import Data.Aeson (FromJSON)
@@ -56,14 +57,16 @@ data Format =
56 | Other 57 | Other
57 58
58formatFromExt :: String -> Format 59formatFromExt :: String -> Format
59formatFromExt ".bmp" = Bmp 60formatFromExt = aux . (map toLower)
60formatFromExt ".jpg" = Jpg 61 where
61formatFromExt ".jpeg" = Jpg 62 aux ".bmp" = Bmp
62formatFromExt ".png" = Png 63 aux ".jpg" = Jpg
63formatFromExt ".tiff" = Tiff 64 aux ".jpeg" = Jpg
64formatFromExt ".hdr" = Hdr 65 aux ".png" = Png
65formatFromExt ".gif" = Gif 66 aux ".tiff" = Tiff
66formatFromExt _ = Other 67 aux ".hdr" = Hdr
68 aux ".gif" = Gif
69 aux _ = Other
67 70
68data Resolution = Resolution 71data Resolution = Resolution
69 { width :: Int 72 { width :: Int