diff options
author | pacien | 2020-01-31 18:15:41 +0100 |
---|---|---|
committer | pacien | 2020-01-31 18:25:26 +0100 |
commit | b1cdddcca9b627e8ba1f2870aa5e62043f7b04b3 (patch) | |
tree | 9846c9a94147df339d1e1a23305cb0ad28bb50cb /compiler/src/Processors.hs | |
parent | 245fee3fe5abdc6ad14513ef6522446aba4c905a (diff) | |
download | ldgallery-b1cdddcca9b627e8ba1f2870aa5e62043f7b04b3.tar.gz |
compiler: auto orient processed images
Let ImageMagick re-orient images based on EXIF metadata.
Some web browsers still don't support that correctly.
GitHub: closes #67
Diffstat (limited to 'compiler/src/Processors.hs')
-rw-r--r-- | compiler/src/Processors.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/src/Processors.hs b/compiler/src/Processors.hs index f2ade63..df7e632 100644 --- a/compiler/src/Processors.hs +++ b/compiler/src/Processors.hs | |||
@@ -86,7 +86,11 @@ resizePictureUpTo maxResolution inputPath outputPath = | |||
86 | maxSize Resolution{width, height} = show width ++ "x" ++ show height ++ ">" | 86 | maxSize Resolution{width, height} = show width ++ "x" ++ show height ++ ">" |
87 | 87 | ||
88 | resize :: FileName -> FileName -> IO () | 88 | resize :: FileName -> FileName -> IO () |
89 | resize input output = callProcess "magick" [input, "-resize", maxSize maxResolution, output] | 89 | resize input output = callProcess "magick" |
90 | [ input | ||
91 | , "-auto-orient" | ||
92 | , "-resize", maxSize maxResolution | ||
93 | , output ] | ||
90 | 94 | ||
91 | 95 | ||
92 | type Cache = FileProcessor -> FileProcessor | 96 | type Cache = FileProcessor -> FileProcessor |