aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Processors.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/Processors.hs')
-rw-r--r--compiler/src/Processors.hs21
1 files changed, 11 insertions, 10 deletions
diff --git a/compiler/src/Processors.hs b/compiler/src/Processors.hs
index dab9aaa..2525af4 100644
--- a/compiler/src/Processors.hs
+++ b/compiler/src/Processors.hs
@@ -1,7 +1,7 @@
1-- ldgallery - A static generator which turns a collection of tagged 1-- ldgallery - A static generator which turns a collection of tagged
2-- pictures into a searchable web gallery. 2-- pictures into a searchable web gallery.
3-- 3--
4-- Copyright (C) 2019 Pacien TRAN-GIRARD 4-- Copyright (C) 2019-2020 Pacien TRAN-GIRARD
5-- 5--
6-- This program is free software: you can redistribute it and/or modify 6-- This program is free software: you can redistribute it and/or modify
7-- it under the terms of the GNU Affero General Public License as 7-- it under the terms of the GNU Affero General Public License as
@@ -60,16 +60,17 @@ data Format =
60 | Unknown 60 | Unknown
61 61
62formatFromPath :: Path -> Format 62formatFromPath :: Path -> Format
63formatFromPath = aux . (map toLower) . takeExtension . fileName 63formatFromPath = maybe Unknown fromExt . fmap (map toLower) . fmap takeExtension . fileName
64 where 64 where
65 aux ".bmp" = Bmp 65 fromExt :: String -> Format
66 aux ".jpg" = Jpg 66 fromExt ".bmp" = Bmp
67 aux ".jpeg" = Jpg 67 fromExt ".jpg" = Jpg
68 aux ".png" = Png 68 fromExt ".jpeg" = Jpg
69 aux ".tiff" = Tiff 69 fromExt ".png" = Png
70 aux ".hdr" = Hdr 70 fromExt ".tiff" = Tiff
71 aux ".gif" = Gif 71 fromExt ".hdr" = Hdr
72 aux _ = Unknown 72 fromExt ".gif" = Gif
73 fromExt _ = Unknown
73 74
74 75
75type FileProcessor = 76type FileProcessor =