Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore compilation files. cleanup readme. fix duplicated versions. #29

Merged
merged 4 commits into from Dec 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -24,3 +24,6 @@ Gemfile.lock
tmp

## PROJECT::SPECIFIC
ext/phashion_ext/include/
ext/phashion_ext/lib/
lib/phashion_ext.bundle
2 changes: 1 addition & 1 deletion 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
Expand Down
74 changes: 52 additions & 22 deletions README.md
@@ -1,57 +1,87 @@
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)
img2 = Phashion::Image.new(filename2)
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 Mike Perham. See LICENSE for details.
Copyright (c) 2010-2014 Mike Perham. See LICENSE for details.
2 changes: 1 addition & 1 deletion lib/phashion.rb
Expand Up @@ -9,7 +9,7 @@
require 'rbconfig'

module Phashion
VERSION = '1.0.6'
VERSION = '1.0.8'

class Image
SETTINGS = {
Expand Down