rpdiff 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rpdiff.rb +4 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c6adc1eb018458e95d311c1e48204ffc8b7a91b
|
4
|
+
data.tar.gz: df6308fce5c3c1960e900172ecc9f8c3e0f26918
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c04b1b0d38d530cf5436d7eeec245e95a480a669bb1f2e6cee4b5b100c615f21ce499b8df0ff86adbd9d78644aee811c9afc5c32c556608c053d54a2279fe43
|
7
|
+
data.tar.gz: 58e53cb35a75b2b76cfce776607c32252403fad88037cb1ede07835912c354d4e80ce771b77239facd7c51cc25d27dd5c7b39cfad9adca1c41936b317af6695a
|
data/lib/rpdiff.rb
CHANGED
@@ -4,7 +4,7 @@ class RPDiff
|
|
4
4
|
|
5
5
|
|
6
6
|
attr_reader :visibly_different, :identical, :indistinguishable, :pixel_difference,
|
7
|
-
:img1, :img2, :fov, :threshold, :gamma, :luminance, :match_percentage
|
7
|
+
:img1, :img2, :fov, :threshold, :gamma, :luminance, :match_percentage, :incomparable
|
8
8
|
|
9
9
|
def initialize(img1, img2, options={})
|
10
10
|
@img1, @img2, @options = img1, img2, options
|
@@ -27,15 +27,14 @@ class RPDiff
|
|
27
27
|
@visibly_different = true if line =~ /FAIL: Images are visibly different/
|
28
28
|
@identical = true if line =~ /PASS: Images are binary identical/
|
29
29
|
@indistinguishable = true if line =~ /PASS: Images are perceptually indistinguishable/
|
30
|
-
@incomparable = true if line =~ /FAIL:
|
30
|
+
@incomparable = true if line =~ /FAIL: Image dimensions do not match/
|
31
31
|
end
|
32
|
-
|
33
|
-
puts io
|
32
|
+
io
|
34
33
|
end
|
35
34
|
|
36
35
|
#Optional gem requirement to get a % value out of image similarity.
|
37
36
|
def calculate_match_percentage
|
38
|
-
return 0 if
|
37
|
+
return 0 if incomparable
|
39
38
|
@image_sizes = FastImage.size(@img1)
|
40
39
|
@match_percentage = 100 - (@pixel_difference.to_f * 100 / (@image_sizes.first * @image_sizes.last).to_f)
|
41
40
|
end
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Benmergui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastimage
|