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.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/src/Processors.hs b/compiler/src/Processors.hs
index ca8a74c..2988f83 100644
--- a/compiler/src/Processors.hs
+++ b/compiler/src/Processors.hs
@@ -47,8 +47,8 @@ data ProcessingException = ProcessingException FilePath String deriving Show
47instance Exception ProcessingException 47instance Exception ProcessingException
48 48
49 49
50-- TODO: handle video, music, markdown, pdf... 50-- TODO: handle video, music, markdown...
51data Format = PictureFormat | PlainTextFormat | Unknown 51data Format = PictureFormat | PlainTextFormat | PortableDocumentFormat | Unknown
52 52
53formatFromPath :: Path -> Format 53formatFromPath :: Path -> Format
54formatFromPath = 54formatFromPath =
@@ -68,6 +68,7 @@ formatFromPath =
68 ".gif" -> PictureFormat 68 ".gif" -> PictureFormat
69 ".txt" -> PlainTextFormat 69 ".txt" -> PlainTextFormat
70 ".md" -> PlainTextFormat -- TODO: handle markdown separately 70 ".md" -> PlainTextFormat -- TODO: handle markdown separately
71 ".pdf" -> PortableDocumentFormat
71 _ -> Unknown 72 _ -> Unknown
72 73
73 74
@@ -173,6 +174,7 @@ itemFileProcessor maxResolution cached inputBase outputBase resClass inputRes =
173 processorFor PictureFormat (Just maxRes) = (resizePictureUpTo maxRes, getPictureProps) 174 processorFor PictureFormat (Just maxRes) = (resizePictureUpTo maxRes, getPictureProps)
174 processorFor PictureFormat Nothing = (copyFileProcessor, getPictureProps) 175 processorFor PictureFormat Nothing = (copyFileProcessor, getPictureProps)
175 processorFor PlainTextFormat _ = (copyFileProcessor, const $ return . PlainText) 176 processorFor PlainTextFormat _ = (copyFileProcessor, const $ return . PlainText)
177 processorFor PortableDocumentFormat _ = (copyFileProcessor, const $ return . PDF)
176 -- TODO: handle video reencoding and others? 178 -- TODO: handle video reencoding and others?
177 processorFor Unknown _ = (copyFileProcessor, const $ return . Other) 179 processorFor Unknown _ = (copyFileProcessor, const $ return . Other)
178 180