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