rpdiff 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rpdiff.rb +4 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb4012588387f5236a6f32bbbee6cb8514911dc6
4
- data.tar.gz: 6036b3ca34477bf3990c1f99fea48572a528e989
3
+ metadata.gz: 8c6adc1eb018458e95d311c1e48204ffc8b7a91b
4
+ data.tar.gz: df6308fce5c3c1960e900172ecc9f8c3e0f26918
5
5
  SHA512:
6
- metadata.gz: 65efb722d4ec474544051214ebadcb5da44bac2b15805d098d16d088ab69b63c4806a5b78c19ffca8faa17593a3dadae30596a274e3ee8fd8f3d7e4b92a79a3e
7
- data.tar.gz: 2225a50adbbf2bd51d6d298343e07f7fb29b0fafec26812f8915f2420875a496bbbc166a2a7140ead58dd33fcf13c084b32d5218415a5618caa99067ff8c8954
6
+ metadata.gz: 4c04b1b0d38d530cf5436d7eeec245e95a480a669bb1f2e6cee4b5b100c615f21ce499b8df0ff86adbd9d78644aee811c9afc5c32c556608c053d54a2279fe43
7
+ data.tar.gz: 58e53cb35a75b2b76cfce776607c32252403fad88037cb1ede07835912c354d4e80ce771b77239facd7c51cc25d27dd5c7b39cfad9adca1c41936b317af6695a
@@ -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: Images dimensions do not match/
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 @incomparable
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.3
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-27 00:00:00.000000000 Z
11
+ date: 2015-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastimage