phash 0.0.3 → 0.0.4
raw patch · 5 files changed
+45/−21 lines, 5 filesdep ~base
Dependency ranges changed: base
Files
- README.md +5/−0
- phash.cabal +16/−4
- src/Data/PHash.hs +6/−5
- src/Data/PHash/Image.hs +7/−5
- test/Test.hs +11/−7
README.md view
@@ -27,3 +27,8 @@ # Credit All credit goes to the original pHash authors. For more information about pHash visit http://phash.org++# Contributors++* [Michael Xavier](http://github.com/MichaelXavier)+* [Hans Raaf](https://github.com/oderwat)
phash.cabal view
@@ -1,5 +1,5 @@ name: phash-version: 0.0.3+version: 0.0.4 synopsis: Haskell bindings to pHash, the open source perceptual hash library description: See http://www.phash.org/ for more info. Note that you must have libphash installed on your system to use this@@ -16,28 +16,40 @@ homepage: http://github.com/michaelxavier/phash bug-reports: http://github.com/michaelxavier/phash/issues +flag lib-Werror+ default: False+ manual: True+ library exposed-modules: Data.PHash exposed-modules: Data.PHash.Image exposed-modules: Data.PHash.Types- build-depends: base >= 4.6 && < 4.8+ build-depends: base >= 4.6 && < 4.9 hs-source-dirs: src default-language: Haskell2010 extra-libraries: pHash+ if flag(lib-Werror)+ ghc-options: -Werror + ghc-options: -Wall+ test-suite spec type: exitcode-stdio-1.0 main-is: Test.hs default-language: Haskell2010 hs-source-dirs: src, test extra-libraries: pHash- build-depends: base >= 4.6 && < 4.8+ build-depends: base build-depends: tasty >= 0.7 && < 1.0 build-depends: tasty-smallcheck >= 0.2 && < 1.0 build-depends: tasty-hunit >= 0.4.1 && < 1.0 build-depends: HUnit >= 1.2.5.2 && < 2.0 build-depends: smallcheck+ if flag(lib-Werror)+ ghc-options: -Werror + ghc-options: -Wall+ test-suite docs type: exitcode-stdio-1.0 main-is: DocTest.hs@@ -45,7 +57,7 @@ hs-source-dirs: src, test extra-libraries: pHash ghc-options: -threaded- build-depends: base >= 4.6 && < 4.8+ build-depends: base build-depends: doctest >= 0.9.10 && < 1.0 build-depends: phash
src/Data/PHash.hs view
@@ -4,12 +4,13 @@ , module Data.PHash.Image , module Data.PHash.Types ) where -import Control.Applicative ( (<$>)- , (<*>) )-import Foreign.C.Types+import Control.Applicative+import Foreign.C.Types -import Data.PHash.Image-import Data.PHash.Types+import Prelude++import Data.PHash.Image+import Data.PHash.Types {-| Calculate the distance between two hashes. This can be used to detect how
src/Data/PHash/Image.hs view
@@ -1,12 +1,14 @@ {-# LANGUAGE ForeignFunctionInterface #-} module Data.PHash.Image ( imageHash ) where -import Control.Applicative ((<$>))-import Foreign-import Foreign.C.String-import Foreign.C.Types+import Control.Applicative+import Foreign+import Foreign.C.String+import Foreign.C.Types -import Data.PHash.Types+import Prelude++import Data.PHash.Types -- $setup -- >>> let imgPath = "test/fixtures/grump.jpg"
test/Test.hs view
@@ -1,13 +1,17 @@-{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-}-import Control.Applicative-import Test.Tasty-import Test.Tasty.SmallCheck-import Test.Tasty.HUnit-import Test.SmallCheck.Series+{-# OPTIONS_GHC -fno-warn-orphans #-}+import Control.Applicative+import Test.SmallCheck.Series+import Test.Tasty+import Test.Tasty.HUnit+import Test.Tasty.SmallCheck -import Data.PHash+import Prelude +import Data.PHash++main :: IO () main = defaultMain tests tests :: TestTree