easyimg_utils 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/easyimg_utils.rb +9 -2
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b1dfaea58127ef88f5b78e46e00146d925b9cc9e05c7c8836d9d934a9cb87b5
|
4
|
+
data.tar.gz: d54061b87a0864110935762bfcd8558552fdaf0e925b3446aa1c22667a8ef41f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c66d8a62d782f4a1535df8351984c05701c6bfb0868cc42c266983054de86b70dc1238888108aa0492bd689d27b3485058fee7c1fe57175c495bc4bcad884c92
|
7
|
+
data.tar.gz: c1ddf021ed6e85154dc13d3b1dbcc59c47d8bac8066acbd8502d5f4704aa7296b3d713e0b9171c796e6bbe4e4530684d1e3c8d1bfe83c73aac055535cb6e6304
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/easyimg_utils.rb
CHANGED
@@ -195,7 +195,8 @@ class EasyImgUtils
|
|
195
195
|
|
196
196
|
# find the top y
|
197
197
|
box = found.max_by {|x, y, width, height| y}
|
198
|
-
box
|
198
|
+
y, height = box.values_at 1, 3
|
199
|
+
y - (height / 2)
|
199
200
|
|
200
201
|
else
|
201
202
|
|
@@ -612,7 +613,13 @@ class EasyImgUtils
|
|
612
613
|
end
|
613
614
|
|
614
615
|
a2 = a.map(&:sum)
|
615
|
-
a2
|
616
|
+
puts 'a2: ' + a2.inspect if @debug
|
617
|
+
#a2.index(a2.max) + 1
|
618
|
+
# attempt to detect the 1st occurrence of contrast
|
619
|
+
r = a2.detect {|x| x > 600}
|
620
|
+
# otherwise select any occurrence of high contrast
|
621
|
+
r = a2.max unless r
|
622
|
+
a2.index(r) + 1
|
616
623
|
|
617
624
|
end
|
618
625
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easyimg_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
KY48n99T12IOioQ4ghCO1L/UAg2taLOcZbMv4WpV1p9bXKhnrow81zeogZjjiNGS
|
36
36
|
OmTAjCfyGFPC/1eXnSV5Smv8
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2021-03-
|
38
|
+
date: 2021-03-24 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rmagick
|
metadata.gz.sig
CHANGED
Binary file
|