From 11e85d3433837a017975324b642b98d9b6e73282 Mon Sep 17 00:00:00 2001 From: Weston Platter Date: Sun, 22 Dec 2013 14:30:56 -0700 Subject: [PATCH 1/4] ignore files/code generated from compilation --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 80f17ee..2cd62c6 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,6 @@ Gemfile.lock tmp ## PROJECT::SPECIFIC +ext/phashion_ext/include/ +ext/phashion_ext/lib/ +lib/phashion_ext.bundle From 1634a4836846fec50985bdcc0b638fee8d8d3654 Mon Sep 17 00:00:00 2001 From: Weston Platter Date: Sun, 22 Dec 2013 14:46:28 -0700 Subject: [PATCH 2/4] update copyright years --- LICENSE | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 7673cbf..d15e8e9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011 Mike Perham +Copyright (c) 2010-2014 Mike Perham Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.md b/README.md index 29640b7..65c512e 100644 --- a/README.md +++ b/README.md @@ -54,4 +54,4 @@ Mike Perham, http://mikeperham.com, http://twitter.com/mperham, mperham AT gmail Copyright ---------- -Copyright (c) 2010 Mike Perham. See LICENSE for details. +Copyright (c) 2010-2014 Mike Perham. See LICENSE for details. From a55ef86d43976689750b215590b64e0e9343b7cf Mon Sep 17 00:00:00 2001 From: Weston Platter Date: Sun, 22 Dec 2013 14:59:30 -0700 Subject: [PATCH 3/4] fixes westonplatter/phashion#25. more details: * explain custom pHash version * list out tested platforms * remove first person usage since repo owner changed * keep text below 80 columns --- README.md | 72 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 65c512e..85a7ccf 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,51 @@ Phashion -=========== +======== -Phashion is a Ruby wrapper around the pHash library, "perceptual hash", which detects duplicate -and near duplicate multimedia files (images, audio, video). The wrapper currently only supports images. +Phashion is a Ruby wrapper around the pHash library, "perceptual hash", which +detects duplicate and near duplicate multimedia files (images, audio, video). +The wrapper currently only supports images. -[See an overview of Phashion on my blog](http://www.mikeperham.com/2010/05/21/detecting-duplicate-images-with-phashion/). +[See an overview of Phashion on Mike's blog] +(http://www.mikeperham.com/2010/05/21/detecting-duplicate-images-with-phashion/). Installation -------------- +------------ You install it just like any other Ruby gem: gem install phashion -Phashion is somewhat involved to install as it has a few dependencies. I've wrapped up those -dependencies into a custom tarball that is built locally just for this gem so you don't have to -do anything special. See the code in `ext/phashion_ext` for more details. +Phashion is somewhat involved to install as it has a few dependencies. Phashion +wrapps these dependencies into a custom tarball that is built locally just +for this gem so you don't have to do anything special. Look in the +`ext/phashion_ext` folder for more details. + +Because of this complexity, it is possible the gem install will fail on your +platform. Phashion has been tested on: + +* Mac OSX 10.6 +* Mac OSX 10.9 +* Ubuntu 8.04 +* Ubuntu 12.04 -Because of this complexity, it is possible the gem install will fail on your platform. I've tested -it on Mac OSX 10.6 and Ubuntu 8.04 but please contact me if you have installation problems. +Please open a [GitHub issue](https://github.com/westonplatter/phashion/issues/) +if you have installation problems. + + +Common Error: library not found for -ljpeg +------------------------------------------ If you have an error upon install, like: ld: library not found for -ljpeg -you need to install libjpeg. "brew install libjpeg" or "port install jpeg" on OSX. +you need to install libjpeg. If you're on a Mac, you can use +[homebrew](http://brew.sh/) `brew install libjpeg` or +[ports](http://www.macports.org/) `port install jpeg` . + Usage ---------- +----- require 'phashion' img1 = Phashion::Image.new(filename1) @@ -35,23 +53,35 @@ Usage img1.duplicate?(img2) --> true + +Gem uses customized pHash 0.9.6 +------------------------------- + +In order to detech duplicate alpha PNGs, the gem uses a custom version of pHash +0.9.6. The customization is limited to only these changes, +[westonplatter/phash@ff255d2] +(https://github.com/westonplatter/phash/commit/ff255d2d3f93c841b98923ecbde997027f21ae36). +The gem will be moving back to the pHash master branch once it supports +detection of alpha PNG file types. Testing ------------- +------- To run the test suite: -```bash -bundle -rake compile -rake -``` + bundle + rake compile + rake + Author -========== +====== -Mike Perham, http://mikeperham.com, http://twitter.com/mperham, mperham AT gmail.com +Mike Perham, +http://mikeperham.com, +http://twitter.com/mperham, +mperham AT gmail.com Copyright ----------- +--------- Copyright (c) 2010-2014 Mike Perham. See LICENSE for details. From ed53aaeb0f12b0a5318bf1341788ce443ef2a22c Mon Sep 17 00:00:00 2001 From: Weston Platter Date: Sun, 22 Dec 2013 14:59:54 -0700 Subject: [PATCH 4/4] synchronize fashion version with 1.0.8 gemspec version --- lib/phashion.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/phashion.rb b/lib/phashion.rb index d4354d3..6efafae 100644 --- a/lib/phashion.rb +++ b/lib/phashion.rb @@ -9,7 +9,7 @@ require 'rbconfig' module Phashion - VERSION = '1.0.6' + VERSION = '1.0.8' class Image SETTINGS = {