phashion 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.md +6 -1
- data/ext/phashion_ext/extconf.rb +1 -1
- data/lib/phashion.rb +6 -6
- data/phashion.gemspec +1 -1
- metadata +30 -49
data/CHANGES.md
CHANGED
data/ext/phashion_ext/extconf.rb
CHANGED
data/lib/phashion.rb
CHANGED
@@ -7,22 +7,22 @@
|
|
7
7
|
# int ph_hamming_distance(ulong64 hasha, ulong64 hashb);
|
8
8
|
|
9
9
|
module Phashion
|
10
|
-
VERSION = '1.0.
|
11
|
-
|
10
|
+
VERSION = '1.0.4'
|
11
|
+
|
12
12
|
class Image
|
13
13
|
SETTINGS = {
|
14
14
|
:dupe_threshold => 15
|
15
15
|
}
|
16
|
-
|
16
|
+
|
17
17
|
attr_reader :filename
|
18
18
|
def initialize(filename)
|
19
19
|
@filename = filename
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
def duplicate?(other)
|
23
23
|
Phashion.hamming_distance(fingerprint, other.fingerprint) < SETTINGS[:dupe_threshold]
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def fingerprint
|
27
27
|
@hash ||= Phashion.image_hash_for(@filename)
|
28
28
|
end
|
@@ -30,4 +30,4 @@ module Phashion
|
|
30
30
|
|
31
31
|
end
|
32
32
|
|
33
|
-
require 'phashion_ext'
|
33
|
+
require 'phashion_ext'
|
data/phashion.gemspec
CHANGED
metadata
CHANGED
@@ -1,46 +1,34 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: phashion
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 1
|
7
|
-
- 0
|
8
|
-
- 3
|
9
|
-
version: 1.0.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.4
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Mike Perham
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-11-09 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: rake-compiler
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70302466299500 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 0
|
30
|
-
- 7
|
31
|
-
- 0
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
32
21
|
version: 0.7.0
|
33
22
|
type: :development
|
34
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70302466299500
|
35
25
|
description: Simple wrapper around the pHash library
|
36
26
|
email: mperham@gmail.com
|
37
27
|
executables: []
|
38
|
-
|
39
|
-
extensions:
|
28
|
+
extensions:
|
40
29
|
- ext/phashion_ext/extconf.rb
|
41
30
|
extra_rdoc_files: []
|
42
|
-
|
43
|
-
files:
|
31
|
+
files:
|
44
32
|
- .document
|
45
33
|
- .gitignore
|
46
34
|
- CHANGES.md
|
@@ -65,39 +53,32 @@ files:
|
|
65
53
|
- test/jpg/e7397898a7e395c2524978a5e64de0efabf08290.jpeg
|
66
54
|
- test/png/Broccoli_Super_Food.png
|
67
55
|
- test/test_phashion.rb
|
68
|
-
has_rdoc: true
|
69
56
|
homepage: http://github.com/mperham/phashion
|
70
57
|
licenses: []
|
71
|
-
|
72
58
|
post_install_message:
|
73
|
-
rdoc_options:
|
59
|
+
rdoc_options:
|
74
60
|
- --charset=UTF-8
|
75
|
-
require_paths:
|
61
|
+
require_paths:
|
76
62
|
- lib
|
77
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
64
|
none: false
|
79
|
-
requirements:
|
80
|
-
- -
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
|
83
|
-
|
84
|
-
version: "0"
|
85
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
70
|
none: false
|
87
|
-
requirements:
|
88
|
-
- -
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
|
91
|
-
- 0
|
92
|
-
version: "0"
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
93
75
|
requirements: []
|
94
|
-
|
95
76
|
rubyforge_project:
|
96
|
-
rubygems_version: 1.
|
77
|
+
rubygems_version: 1.8.7
|
97
78
|
signing_key:
|
98
79
|
specification_version: 3
|
99
80
|
summary: Simple wrapper around the pHash library
|
100
|
-
test_files:
|
81
|
+
test_files:
|
101
82
|
- test/gif/Broccoli_Super_Food.gif
|
102
83
|
- test/helper.rb
|
103
84
|
- test/jpg/86x86-0a1e.jpeg
|