Permalink
Browse files

Update to pHash 0.9.3 and CImg 1.4.7, prepare for 1.0.3 release

  • Loading branch information...
1 parent 764ace9 commit ffc7dc3425eb53ec1d222e0ba312b33dd3e1255a @mperham mperham committed Jan 29, 2011
View
@@ -1,6 +1,12 @@
History
=========
+1.0.3
+-------
+
+* Update pHash to version 0.9.3 and CImg 1.4.7.
+* Fix a few build issues.
+
1.0.2
-------
View
@@ -1,4 +1,4 @@
-Copyright (c) 2010 Mike Perham
+Copyright (c) 2011 Mike Perham
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
@@ -20,6 +20,12 @@ do anything special. See the code in `ext/phashion_ext` for more details.
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.
+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.
+
Usage
---------
View
@@ -1,24 +1,6 @@
require 'rubygems'
require 'rake'
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "phashion"
- gem.summary = %Q{Simple wrapper around the pHash library}
- gem.description = gem.summary
- gem.email = "mperham@gmail.com"
- gem.homepage = "http://github.com/mperham/phashion"
- gem.authors = ["Mike Perham"]
- gem.add_development_dependency 'rake-compiler', '>= 0.7.0'
- gem.version = '1.0.2'
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
-end
-
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
@@ -39,7 +21,7 @@ rescue LoadError
end
end
-task :test => :check_dependencies
+task :test
task :default => :test
Binary file not shown.
Binary file not shown.
View
@@ -7,7 +7,7 @@
# int ph_hamming_distance(ulong64 hasha, ulong64 hashb);
module Phashion
- VERSION = '1.0.2'
+ VERSION = '1.0.3'
class Image
SETTINGS = {
@@ -27,7 +27,7 @@ def fingerprint
@hash ||= Phashion.image_hash_for(@filename)
end
end
-
+
end
require 'phashion_ext'
View
@@ -5,18 +5,12 @@
Gem::Specification.new do |s|
s.name = %q{phashion}
- s.version = "1.0.2"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.version = "1.0.3"
s.authors = ["Mike Perham"]
s.date = %q{2010-06-04}
s.description = %q{Simple wrapper around the pHash library}
s.email = %q{mperham@gmail.com}
s.extensions = ["ext/phashion_ext/extconf.rb"]
- s.extra_rdoc_files = [
- "LICENSE",
- "README.md"
- ]
s.files = [
".document",
".gitignore",
@@ -26,7 +20,7 @@ Gem::Specification.new do |s|
"Rakefile",
"TODO.md",
"ext/phashion_ext/extconf.rb",
- "ext/phashion_ext/pHash-0.9.0.tar.gz",
+ "ext/phashion_ext/pHash-0.9.3.tar.gz",
"ext/phashion_ext/phashion_ext.c",
"lib/phashion.rb",
"phashion.gemspec",
@@ -43,24 +37,11 @@ Gem::Specification.new do |s|
s.homepage = %q{http://github.com/mperham/phashion}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.6}
s.summary = %q{Simple wrapper around the pHash library}
s.test_files = [
"test/helper.rb",
"test/test_phashion.rb"
]
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<rake-compiler>, [">= 0.7.0"])
- else
- s.add_dependency(%q<rake-compiler>, [">= 0.7.0"])
- end
- else
- s.add_dependency(%q<rake-compiler>, [">= 0.7.0"])
- end
+ s.add_development_dependency(%q<rake-compiler>, [">= 0.7.0"])
end
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -4,28 +4,37 @@ class TestPhashion < Test::Unit::TestCase
def test_duplicate_detection
files = %w(86x86-0a1e.jpeg 86x86-83d6.jpeg 86x86-a855.jpeg)
- images = files.map {|f| Phashion::Image.new("#{File.dirname(__FILE__) + '/../test/'}#{f}")}
+ images = files.map {|f| Phashion::Image.new("#{File.dirname(__FILE__) + '/../test/jpg/'}#{f}")}
assert_duplicate images[0], images[1]
assert_duplicate images[1], images[2]
assert_duplicate images[0], images[2]
end
def test_duplicate_detection_2
files = %w(b32aade8c590e2d776c24f35868f0c7a588f51e1.jpeg df9cc82f5b32d7463f36620c61854fde9d939f7f.jpeg e7397898a7e395c2524978a5e64de0efabf08290.jpeg)
- images = files.map {|f| Phashion::Image.new("#{File.dirname(__FILE__) + '/../test/'}#{f}")}
+ images = files.map {|f| Phashion::Image.new("#{File.dirname(__FILE__) + '/../test/jpg/'}#{f}")}
assert_duplicate images[0], images[1]
assert_duplicate images[1], images[2]
assert_duplicate images[0], images[2]
end
def test_not_duplicate
files = %w(86x86-0a1e.jpeg 86x86-83d6.jpeg 86x86-a855.jpeg avatar.jpg)
- images = files.map {|f| Phashion::Image.new("#{File.dirname(__FILE__) + '/../test/'}#{f}")}
+ images = files.map {|f| Phashion::Image.new("#{File.dirname(__FILE__) + '/../test/jpg/'}#{f}")}
assert_not_duplicate images[0], images[3]
assert_not_duplicate images[1], images[3]
assert_not_duplicate images[2], images[3]
end
+ def test_multiple_types
+ jpg = Phashion::Image.new(File.dirname(__FILE__) + '/jpg/Broccoli_Super_Food.jpg')
+ png = Phashion::Image.new(File.dirname(__FILE__) + '/png/Broccoli_Super_Food.png')
+ gif = Phashion::Image.new(File.dirname(__FILE__) + '/gif/Broccoli_Super_Food.gif')
+ assert_duplicate jpg, png
+ assert_duplicate gif, png
+ assert_duplicate jpg, gif
+ end
+
private
def assert_duplicate(a, b)

0 comments on commit ffc7dc3

Please sign in to comment.