paperclip-facecrop 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/opencv_ext.rb +17 -0
- data/lib/paperclip-facecrop.rb +1 -1
- data/paperclip-facecrop.gemspec +1 -1
- metadata +3 -2
data/lib/opencv_ext.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'opencv'
|
2
|
+
|
3
|
+
class OpenCV::CvAvgComp
|
4
|
+
|
5
|
+
# collide?
|
6
|
+
#
|
7
|
+
def collide?(comp)
|
8
|
+
if (self.x < comp.x + comp.width && comp.x < self.x + self.width && self.y < comp.y + comp.height)
|
9
|
+
return comp.y < self.y + self.height
|
10
|
+
end
|
11
|
+
return false
|
12
|
+
end
|
13
|
+
|
14
|
+
def to_s
|
15
|
+
"#{self.x},#{self.y}-#{self.width}x#{self.height}"
|
16
|
+
end
|
17
|
+
end
|
data/lib/paperclip-facecrop.rb
CHANGED
data/paperclip-facecrop.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "paperclip-facecrop"
|
6
|
-
s.version = "0.0.
|
6
|
+
s.version = "0.0.5"
|
7
7
|
s.authors = ["Borja Martín"]
|
8
8
|
s.description = %q{Paperclip processor that is aware of the faces detected on the image so that they don't get cropped or aren't shown too small while generating the thumbnails}
|
9
9
|
s.summary = %q{Paperclip processor that is aware of the faces found on the image}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Borja Mart\xC3\xADn"
|
@@ -60,6 +60,7 @@ files:
|
|
60
60
|
- README_example.jpg
|
61
61
|
- README_example_b.jpg
|
62
62
|
- Rakefile
|
63
|
+
- lib/opencv_ext.rb
|
63
64
|
- lib/paperclip-facecrop.rb
|
64
65
|
- paperclip-facecrop.gemspec
|
65
66
|
has_rdoc: true
|