Skip to content

Commit

Permalink
Update for GHC 8.0.2. Update optimization. Update version number.
Browse files Browse the repository at this point in the history
  • Loading branch information
lettier committed Sep 9, 2017
1 parent a5c0381 commit 2971cc9
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 52 deletions.
56 changes: 29 additions & 27 deletions Gifcurry.cabal
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: Gifcurry
version: 2.1.0.0
synopsis: Create animated GIFs, overlaid with optional text, from video files.
description: GIF creation utility.
version: 2.1.1.0
synopsis: GIF creation utility.
description: Create animated GIFs, optionally overlaid with text, from video files.
homepage: https://github.com/lettier/gifcurry
license: Apache-2.0
license-file: LICENSE
author: Lettier
maintainer: Lettier
copyright: (C) 2016 David Lettier
category: Graphics
category: Application
, Library
, Graphics
build-type: Simple
extra-source-files: README.md
, ./src/dev/Paths_Gifcurry.hs
Expand All @@ -26,42 +28,42 @@ source-repository head

library
exposed-modules: Gifcurry
build-depends: base >=4.7 && <=4.9.0.0
, process >=1.2 && <=1.4.2.0
, temporary >=1.2 && <1.3
, directory ==1.2.*
, text ==1.2.*
, filepath ==1.4.*
build-depends: base >= 4.7 && < 5
, process >= 1.2 && <= 1.4.4
, temporary >= 1.2 && < 1.3
, directory == 1.3.*
, text == 1.2.*
, filepath == 1.4.*
hs-source-dirs: ./src
, ./src/lib/
ghc-options: -Wall
default-language: Haskell2010

executable gifcurry_gui
executable gifcurry_gui
main-is: Main.hs
build-depends: base >=4.7 && <=4.9.0.0
, gtk3 >=0.14 && <0.15
, process >=1.2 && <=1.4.2.0
, temporary >=1.2 && <1.3
, directory ==1.2.*
, text ==1.2.*
, filepath ==1.4.*
build-depends: base >= 4.7 && < 5
, gtk3 >= 0.14 && < 0.15
, process >= 1.2 && <= 1.4.4
, temporary >= 1.2 && < 1.3
, directory == 1.3.*
, text == 1.2.*
, filepath == 1.4.*
other-modules: Paths_Gifcurry, Gifcurry
ghc-options: -O3 -threaded -with-rtsopts=-N -Wall
ghc-options: -O -threaded -with-rtsopts=-N -Wall
hs-source-dirs: ./src/
, ./src/gui/
, ./src/lib/
default-language: Haskell2010

executable gifcurry_cli
executable gifcurry_cli
main-is: Main.hs
build-depends: base >=4.7 && <=4.9.0.0
, process >=1.2 && <=1.4.2.0
, temporary >=1.2 && <1.3
, directory == 1.2.*
, cmdargs ==0.10.*
, text ==1.2.*
, filepath ==1.4.*
build-depends: base >= 4.7 && < 5
, process >= 1.2 && <= 1.4.4
, temporary >= 1.2 && < 1.3
, directory == 1.3.*
, cmdargs == 0.10.*
, text == 1.2.*
, filepath == 1.4.*
other-modules: Gifcurry
ghc-options: -Wall
hs-source-dirs: ./src/
Expand Down
18 changes: 9 additions & 9 deletions cabal.config
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
constraints: base ==4.9.0.0,
constraints: base ==4.9.1.0,
ghc-prim ==0.5.0.0,
rts ==1.0,
integer-gmp ==1.0.0.1,
directory ==1.2.6.2,
filepath ==1.4.1.0,
directory ==1.3.0.0,
filepath ==1.4.1.1,
time ==1.6.0.1,
deepseq ==1.4.2.0,
array ==0.5.1.1,
unix ==2.7.2.0,
unix ==2.7.2.1,
bytestring ==0.10.8.1,
process ==1.4.2.0,
temporary ==1.2.0.4,
process ==1.4.3.0,
temporary ==1.2.1.1,
exceptions ==0.8.3,
mtl ==2.2.1,
transformers ==0.5.2.0,
stm ==2.4.4.1,
template-haskell ==2.11.0.0,
ghc-boot-th ==8.0.1,
template-haskell ==2.11.1.0,
ghc-boot-th ==8.0.2,
pretty ==1.1.3.3,
transformers-compat ==0.5.1.4,
text ==1.2.2.1,
binary ==0.8.3.0,
containers ==0.5.7.1,
cmdargs ==0.10.14,
cmdargs ==0.10.17,
gtk3 ==0.14.6,
cairo ==0.13.3.1,
utf8-string ==1.0.1.1,
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# http://www.lettier.com/

.RECIPEPREFIX != ps
VERSION='2.1.0.0'
VERSION='2.1.1.0'

all: update alex_happy gtk2hs sandbox clean install_dependencies configure build install

Expand Down
13 changes: 10 additions & 3 deletions src/cli/Main.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
-- David Lettier (C) 2016. http://www.lettier.com/
{-
Gifcurry
(C) 2016 David Lettier
lettier.com
-}

{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE NamedFieldPuns #-}
Expand All @@ -19,6 +23,9 @@ data CliArgs = CliArgs {
, bottomText :: String
} deriving (Data, Typeable, Show, Eq)

info :: String
info = "Gifcurry " ++ Gifcurry.versionNumber ++ "\n(C) 2016 David Lettier\nlettier.com"

cliArgs :: CliArgs
cliArgs = CliArgs {
inputFile = "" &= typFile &= help "The input video file path and name."
Expand All @@ -31,7 +38,7 @@ cliArgs = CliArgs {
, topText = "" &= help "The text you wish to add to the top of the GIF."
, bottomText = "" &= help "The text you wish to add to the bottom of the GIF."
-- VERSION
} &= summary "Gifcurry 2.1.0.0 (C) 2016 David Lettier"
} &= summary info
&= program "gifcurry_cli"

main :: IO ()
Expand Down Expand Up @@ -106,5 +113,5 @@ printHeader = mapM_ putStrLn [
, " \\____/_|_| \\___|\\__,_|_| |_| \\__, |"
, " __/ |"
, " |___/ "
, "\nGifcurry (C) 2016 David Lettier. https://www.lettier.com/"
, info
]
6 changes: 6 additions & 0 deletions src/dev/Paths_Gifcurry.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{-
Gifcurry
(C) 2016 David Lettier
lettier.com
-}

module Paths_Gifcurry where

getDataFileName :: FilePath -> IO FilePath
Expand Down
6 changes: 5 additions & 1 deletion src/gui/Main.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
-- David Lettier (C) 2016. http://www.lettier.com/
{-
Gifcurry
(C) 2016 David Lettier
lettier.com
-}

import System.Directory
import System.Process
Expand Down
40 changes: 29 additions & 11 deletions src/lib/Gifcurry.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
-- David Lettier (C) 2016. http://www.lettier.com/
{-
Gifcurry
(C) 2016 David Lettier
lettier.com
-}

{-# LANGUAGE OverloadedStrings #-}

Expand All @@ -9,6 +13,7 @@ module Gifcurry (
, GifParams(..)
, defaultGifParams
, gifParamsValid
, versionNumber
) where

import System.Process
Expand Down Expand Up @@ -36,6 +41,10 @@ data GifParams = GifParams {
, bottomText :: String
} deriving (Show, Read)

-- | The version number.
versionNumber :: String
versionNumber = "2.1.1.0"

-- | Specifies default parameters for 'startTime', 'durationTime', 'widthSize', 'qualityPercent', and 'fontChoice'.
defaultGifParams :: GifParams
defaultGifParams = GifParams {
Expand Down Expand Up @@ -156,6 +165,9 @@ printGifParams
, "\nWriting temporary frames to... " ++ tmpdir
]

frameFileExtension :: String
frameFileExtension = "png"

tryFfmpeg :: GifParams -> String -> IO (Either IOError String)
tryFfmpeg
GifParams {
Expand All @@ -181,14 +193,14 @@ tryFfmpeg
, "-t"
, dts
, "-r"
, "15"
, "12"
, "-q:v"
, "2"
, "31"
, "-vf"
, "scale=" ++ wss ++ ":-1"
, "-f"
, "image2"
, tmpdir ++ "/%010d.png"
, tmpdir ++ "/%010d." ++ frameFileExtension
]

tryConvert :: GifParams -> String -> IO (Either IOError String)
Expand All @@ -205,17 +217,23 @@ tryConvert
let params = [
"-quiet"
, "-delay"
, "6"
, "8.3"
, tmpdir ++ "/*." ++ frameFileExtension
, "-coalesce"
, "-colors"
, show $ ncolors qp
, "-coalesce"
, "-layers"
, "OptimizeTransparency"
, "-layers"
, "RemoveDups"
, tmpdir ++ "/*.png"
, "-dither"
, "FloydSteinberg"
, "-layers"
, "remove-dups"
, "-layers"
, "compare-any"
, "-layers"
, "optimize-frame"
, "-layers"
, "optimize-plus"
, "-layers"
, "optimize-transparency"
, "-loop"
, "0"
]
Expand Down

0 comments on commit 2971cc9

Please sign in to comment.