diff options
author | pacien | 2020-02-02 22:31:15 +0100 |
---|---|---|
committer | pacien | 2020-02-02 22:31:15 +0100 |
commit | 5e85fe0743a2ce0d715ce81d37f02729fce01d9c (patch) | |
tree | da3822620b3b1e21c009c2df6101f8be044119e0 | |
parent | b68f037392f393f1d6781fdbd4f28ee4ddc79807 (diff) | |
download | ldgallery-5e85fe0743a2ce0d715ce81d37f02729fce01d9c.tar.gz |
compiler: fix resolution extraction for multilayer images
GitHub: closes #84
-rw-r--r-- | compiler/src/Processors.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/src/Processors.hs b/compiler/src/Processors.hs index fc719af..16837a6 100644 --- a/compiler/src/Processors.hs +++ b/compiler/src/Processors.hs | |||
@@ -126,9 +126,11 @@ resourceAt fsPath resPath = getModificationTime fsPath >>= return . Resource res | |||
126 | 126 | ||
127 | getImageResolution :: FilePath -> IO Resolution | 127 | getImageResolution :: FilePath -> IO Resolution |
128 | getImageResolution fsPath = | 128 | getImageResolution fsPath = |
129 | readProcess "identify" ["-format", "%w %h", fsPath] [] | 129 | readProcess "identify" ["-format", "%w %h", firstFrame] [] |
130 | >>= return . break (== ' ') | 130 | >>= return . break (== ' ') |
131 | >>= return . \(w, h) -> Resolution (read w) (read h) | 131 | >>= return . \(w, h) -> Resolution (read w) (read h) |
132 | where | ||
133 | firstFrame = fsPath ++ "[0]" | ||
132 | 134 | ||
133 | 135 | ||
134 | type ItemFileProcessor = | 136 | type ItemFileProcessor = |