Skip to content

Commit

Permalink
Merge pull request #23 from westonplatter/temp-png-fix
Browse files Browse the repository at this point in the history
fixes #20 patch pHash to support alpha channel PNGs
  • Loading branch information
mperham committed Nov 26, 2013
2 parents aacaa82 + 06ef675 commit 7a13ccd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
Binary file added ext/phashion_ext/pHash-0.9.6-png-patch.tar.gz
Binary file not shown.
Binary file removed ext/phashion_ext/pHash-0.9.6.tar.gz
Binary file not shown.
Binary file added test/png/grass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/png/linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions test/test_phashion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ def test_multiple_types
assert_duplicate gif, png
assert_duplicate jpg, gif
end

def test_fingerprint_png_is_different
png1 = Phashion::Image.new(File.dirname(__FILE__) + '/png/Broccoli_Super_Food.png')
png2 = Phashion::Image.new(File.dirname(__FILE__) + '/png/linux.png')
png3 = Phashion::Image.new(File.dirname(__FILE__) + '/png/grass.png')
png4 = Phashion::Image.new(File.dirname(__FILE__) + '/png/Broccoli_Super_Food.png')

fingerprints = []
fingerprints << png1.fingerprint
fingerprints << png2.fingerprint
fingerprints << png3.fingerprint
fingerprints << png4.fingerprint

assert fingerprints.uniq.size == 3, "array should contain 3 unique fingerprints"
end

private

Expand Down

0 comments on commit 7a13ccd

Please sign in to comment.