perceptual-hash 0.1.0.0 → 0.1.0.1
raw patch · 4 files changed
+17/−16 lines, 4 filesdep ~par-traversePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: par-traverse
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- app/Parallel.hs +1/−1
- perceptual-hash.cabal +7/−7
- src/PerceptualHash.hs +5/−8
CHANGELOG.md view
@@ -1,5 +1,9 @@ # phash +## 0.1.0.1++ * Update to work with latest `par-traverse`+ ## 0.1.0.0 Initial release
app/Parallel.hs view
@@ -32,7 +32,7 @@ pathMaps :: [FilePath] -> IO (M.Map Word64 (NonEmpty FilePath)) pathMaps fps = do total <- newTVarIO mempty- parTraverse (stepMap total) fileFilter fps+ parTraverse (stepMap total) fileFilter (\_ -> pure True) fps readTVarIO total where fileFilter = pure . imgExtension . takeExtension
perceptual-hash.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.0 name: perceptual-hash-version: 0.1.0.0+version: 0.1.0.1 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2019 Vanessa McHale@@ -33,11 +33,11 @@ vector-algorithms -any, vector -any, primitive -any- + if impl(ghc >=8.0) ghc-options: -Wincomplete-uni-patterns -Wincomplete-record-updates -Wredundant-constraints -Widentities- + if impl(ghc >=8.4) ghc-options: -Wmissing-export-lists @@ -58,13 +58,13 @@ containers -any, filepath -any, optparse-applicative >=0.13.0.0,- par-traverse -any,+ par-traverse >=0.2.0.0, stm >=2.3- + if impl(ghc >=8.0) ghc-options: -Wincomplete-uni-patterns -Wincomplete-record-updates -Wredundant-constraints -Widentities- + if impl(ghc >=8.4) ghc-options: -Wmissing-export-lists @@ -80,6 +80,6 @@ perceptual-hash -any, criterion -any, hip -any- + if impl(ghc >=8.4) ghc-options: -Wmissing-export-lists
src/PerceptualHash.hs view
@@ -43,16 +43,13 @@ dct img = dct32 |*| img |*| transpose dct32 imgHash :: Image VU Y Double -> Word64-imgHash = asWord64 . aboveMed . V.map d . toVector . crop8 . dct . size32 . meanFilter- where d :: Pixel Y Double -> Double- d (PixelY x) = x+imgHash = asWord64 . aboveMed . V.map (\(PixelY x) -> x) . toVector . crop8 . dct . size32 . meanFilter - asWord64 :: V.Vector Bool -> Word64+ where asWord64 :: V.Vector Bool -> Word64 asWord64 = V.foldl' (\acc x -> (acc `shiftL` 1) .|. boolToWord64 x) 0-- boolToWord64 :: Bool -> Word64- boolToWord64 False = 0- boolToWord64 True = 1+ where boolToWord64 :: Bool -> Word64+ boolToWord64 False = 0+ boolToWord64 True = 1 aboveMed v = let med = medianImmut v