rpdiff 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rpdiff +4 -5
- data/lib/rpdiff.rb +2 -6
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f262506859e8d511829e9f8deb1e4e1378896e9b
|
4
|
+
data.tar.gz: 42c27b0e6a272f192449f618cf9ae16293615d76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fb0ce55655306af5c0daa676809a3343ccbd5853465c02a46970c94886cc33f1118c532234042774b9b182e9dc6ec1681fefb355bb15056b92709e67818cbbd
|
7
|
+
data.tar.gz: 198f13ede8b5d1fa0f8d3900dd85b63fe98abe599fe7a3eb1ff67e9b2da640a64605e421b9e66e8c40601c1c03ee43a7c50ad22d9c260405adce2373cb22fb9e
|
data/bin/rpdiff
CHANGED
@@ -7,21 +7,20 @@ options = {}
|
|
7
7
|
OptionParser.new do |opts|
|
8
8
|
opts.banner = "Compares image1.tif and image2.tif using a perceptually based image metric. Options:"
|
9
9
|
|
10
|
-
opts.on("-verbose", "Turns on verbose mode") {|val| options[:verbose] =
|
11
|
-
opts.on("-debug", "Turns on perceptualdiff command line output") {|val| options[:debug] =
|
10
|
+
opts.on("-verbose", "Turns on verbose mode") {|val| options[:verbose] = nil}
|
11
|
+
opts.on("-debug", "Turns on perceptualdiff command line output") {|val| options[:debug] = nil}
|
12
12
|
opts.on("-output out.ppm", String, "Write difference to the file o.ppm") {|val| options[:output] = val}
|
13
13
|
opts.on("-fov deg", String, "Field of view in degrees (0.1 to 89.9)") {|val| options[:fov] = val}
|
14
14
|
opts.on("-threshold p", Integer, "#pixels p below which differences are ignored") {|val| options[:threshold] = val}
|
15
15
|
opts.on("-gamma g", Float, "Value to convert rgb into linear space (default 2.2)") {|val| options[:gamma] = val}
|
16
16
|
opts.on("-luminance l", Float, "White luminance (default 100.0 cdm^-2)") {|val| options[:luminance] = val}
|
17
|
-
opts.on("-luminanceonly", "Only consider luminance; ignore chroma (color) in the comparison") {|val| options[:luminanceonly] =
|
18
|
-
opts.on("-match_percentage", "Process pixel match in %") {|val| options[:match_percentage] =
|
17
|
+
opts.on("-luminanceonly", "Only consider luminance; ignore chroma (color) in the comparison") {|val| options[:luminanceonly] = nil}
|
18
|
+
opts.on("-match_percentage", "Process pixel match in %") {|val| options[:match_percentage] = nil}
|
19
19
|
|
20
20
|
opts.parse!
|
21
21
|
if ARGV.count == 2
|
22
22
|
img1, img2 = ARGV
|
23
23
|
|
24
|
-
match_percentage = options.delete :match_percentage
|
25
24
|
rpdiff = RPDiff.new(img1, img2, options)
|
26
25
|
rpdiff.diff
|
27
26
|
else
|
data/lib/rpdiff.rb
CHANGED
@@ -12,8 +12,8 @@ class RPDiff
|
|
12
12
|
@pixel_difference = 0
|
13
13
|
|
14
14
|
opts = "#{@img1} #{@img2} "
|
15
|
-
@options.each {|k, v| opts << "-#{k} #{v}"
|
16
|
-
io = `perceptualdiff
|
15
|
+
@options.each {|k, v| opts << "-#{k} #{v} "}
|
16
|
+
io = `perceptualdiff #{opts}`
|
17
17
|
|
18
18
|
io.split(/\n/).each do |line|
|
19
19
|
@fov = $1 if line =~ /Field of view is (\d+\.\d+) degrees/
|
@@ -27,10 +27,6 @@ class RPDiff
|
|
27
27
|
@incomparable = true if line =~ /FAIL: Images dimensions do not match/
|
28
28
|
end
|
29
29
|
|
30
|
-
if @options[:match_percentage]
|
31
|
-
calculate_match_percentage
|
32
|
-
end
|
33
|
-
|
34
30
|
puts io
|
35
31
|
end
|
36
32
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpdiff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Benmergui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A thin wrapper on Perceptual Diff for ease of use.
|
14
14
|
email: gabriel.benmergui@gmail.com
|
@@ -21,12 +21,13 @@ files:
|
|
21
21
|
- bin/rpdiff
|
22
22
|
- lib/rpdiff.rb
|
23
23
|
homepage: http://github.com/conanbatt/rpdiff
|
24
|
-
licenses:
|
24
|
+
licenses:
|
25
|
+
- MIT
|
25
26
|
metadata: {}
|
26
27
|
post_install_message:
|
27
28
|
rdoc_options: []
|
28
29
|
require_paths:
|
29
|
-
-
|
30
|
+
- lib
|
30
31
|
required_ruby_version: !ruby/object:Gem::Requirement
|
31
32
|
requirements:
|
32
33
|
- - ">="
|
@@ -39,7 +40,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
39
40
|
version: '0'
|
40
41
|
requirements: []
|
41
42
|
rubyforge_project:
|
42
|
-
rubygems_version: 2.
|
43
|
+
rubygems_version: 2.4.6
|
43
44
|
signing_key:
|
44
45
|
specification_version: 4
|
45
46
|
summary: Rpdiff is a ruby wrapper on Perceptual diff
|