image_compare 1.0.4 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6e3942a469787d0362555e95b4378fdac7c9766c06b70e0c176e916e0732b22
4
- data.tar.gz: acf47bab2a4eee7d2909e7947062e769480c9f1aeceecf809ceeb679287585b3
3
+ metadata.gz: 23eba1fc057ba2ec6ad089496b1ba60b6e7b5290cd181c08cc7d413729b83eff
4
+ data.tar.gz: e3adbb49a9da518ce1867ca09ad8272aac9250b0f6d61a524e4a989a00133d57
5
5
  SHA512:
6
- metadata.gz: f9f2df2f4b996aab9219920b7ee030bd0873b7e6103aff0871e5a161af7ba72d94f96e5431fa3b88dc8c7e046a8727322c2fee80d899d2b95efbd33e05867376
7
- data.tar.gz: 8f879179dc1a0f30def7dd4187ff2bbf9d9716f8fa52a14260efaae107b48e6e4327712c9524666010167f069a229e6d8a5bb855a6d1f072295a6948c39eb1e9
6
+ metadata.gz: 5179a1d7f11c7189188f2027a092cc5f69050148f94e8947218f3f404aa60f11f1c8b266559b0b1c0363b11f4177b0f3ccec284460c62b777917ca0f73d19ccc
7
+ data.tar.gz: da70a3d2e6e085501fda1d3aac1804d811733eeab02549a6cd7395c5eae6d00369b4e1d90360de34020481acb866e3cc90d3988a50789b006fdc5d7db10cbaa4
data/CHANGELOG.md CHANGED
@@ -6,6 +6,8 @@
6
6
  - v1.0.2: Fix gem documentation uri ([@gsguma][])
7
7
  - v1.0.3: Fix documentation ([@gsguma][])
8
8
  - v1.0.4: Fix gem documentation images ([@gsguma][])
9
+ - v1.0.5: Fix gem documentation ([@gsguma][])
10
+ - v1.0.6: Fix the error when trying to add a rect exclude area that is partially outside the image bounds ([@gsguma][])
9
11
 
10
12
  [@gsguma]: https://github.com/gsguma
11
13
  [@cristianofmc]: https://github.com/cristianofmc
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
- [![Gem Version](https://d25lcipzij17d.cloudfront.net/badge.svg?id=rb&r=r&type=6e&v=1.0.3&x2=0)](https://rubygems.org/gems/image_compare)
2
-
3
1
  # ImageCompare
2
+ [<img src="https://shields.io/github/license/instantink/image_compare?color=%2345a34c" />](LICENSE.txt)
3
+ [<img src="https://shields.io/gem/v/image_compare" />](https://rubygems.org/gems/image_compare)
4
+ <img alt="Gem total downloads" src="https://shields.io/gem/dt/image_compare" />
4
5
 
5
6
  Compare PNG images in pure Ruby (uses [ChunkyPNG](https://github.com/wvanbergen/chunky_png)) using different algorithms.
6
7
  This is an utility library for image regression testing.
@@ -32,7 +33,7 @@ ImageCompare supports different ways (_modes_) of comparing images.
32
33
 
33
34
  Source images used in examples:
34
35
 
35
- a1.png
36
+ a.png
36
37
 
37
38
  <img alt="a.png" src="spec/fixtures/a.png" />
38
39
 
@@ -34,12 +34,6 @@ module ImageCompare
34
34
 
35
35
  image_area = Rectangle.new(0, 0, a.width - 1, a.height - 1)
36
36
 
37
- unless mode.exclude_rect.nil?
38
- unless image_area.contains?(mode.exclude_rect)
39
- raise ArgumentError, "Bounds must be in image"
40
- end
41
- end
42
-
43
37
  unless mode.include_rect.nil?
44
38
  unless image_area.contains?(mode.include_rect)
45
39
  raise ArgumentError, "Bounds must be in image"
@@ -19,11 +19,9 @@ module ImageCompare
19
19
  def diff(bg, diff)
20
20
  diff_image = bg.highlight_rectangle(exclude_rect, :blue)
21
21
 
22
- if area_in_exclude_rect?
23
- diff_image
24
- else
25
- diff_image.highlight_rectangle(bounds)
26
- end
22
+ return diff_image if self.result.match?
23
+
24
+ diff_image.highlight_rectangle(bounds) unless area_in_exclude_rect?
27
25
  end
28
26
 
29
27
  def area_in_exclude_rect?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ImageCompare
4
- VERSION = "1.0.4"
4
+ VERSION = "1.0.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_compare
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - cristianofmc
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-03-29 00:00:00.000000000 Z
12
+ date: 2023-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chunky_png
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: '1.4'
20
+ version: 1.3.15
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: '1.4'
27
+ version: 1.3.15
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -91,7 +91,7 @@ licenses:
91
91
  metadata:
92
92
  bug_tracker_uri: https://github.com/instantink/image_compare/issues
93
93
  changelog_uri: https://github.com/instantink/image_compare/blob/master/CHANGELOG.md
94
- documentation_uri: https://www.rubydoc.info/gems/image_compare/1.0.4
94
+ documentation_uri: https://www.rubydoc.info/gems/image_compare/1.0.6
95
95
  homepage_uri: https://github.com/instantink/image_compare
96
96
  source_code_uri: https://github.com/instantink/image_compare
97
97
  post_install_message: