never executed always true always false
1 module Reanimate.Driver.Magick
2 ( magickCmd
3 ) where
4
5 import System.IO.Unsafe (unsafePerformIO)
6 import System.Directory (findExecutable)
7
8 {-# NOINLINE magickCmd #-}
9 -- |The name of the ImageMagick command. On Unix-like operating systems, the
10 -- command \'convert\' does not conflict with the name of other commands. On
11 -- Windows, ImageMagick version 7 is readily available, the command \'magick\'
12 -- should be present, and is preferred over \'convert\'. If it is not present,
13 -- \'convert\' is assumed to be the relevant command.
14 magickCmd :: String
15 -- The use of 'unsafeperformIO' is justified on the basis that if \'magick\' is
16 -- found once, it will always be present.
17 magickCmd = unsafePerformIO $ do
18 mPath <- findExecutable "magick"
19 pure $ maybe "convert" (const "magick") mPath