From 5e85fe0743a2ce0d715ce81d37f02729fce01d9c Mon Sep 17 00:00:00 2001
From: pacien
Date: Sun, 2 Feb 2020 22:31:15 +0100
Subject: compiler: fix resolution extraction for multilayer images

GitHub: closes #84
---
 compiler/src/Processors.hs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'compiler/src/Processors.hs')

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
 
 getImageResolution :: FilePath -> IO Resolution
 getImageResolution fsPath =
-  readProcess "identify" ["-format", "%w %h", fsPath] []
+  readProcess "identify" ["-format", "%w %h", firstFrame] []
   >>= return . break (== ' ')
   >>= return . \(w, h) -> Resolution (read w) (read h)
+  where
+    firstFrame = fsPath ++ "[0]"
 
 
 type ItemFileProcessor =
-- 
cgit v1.2.3