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 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
@@ -1,4 +1,4 @@
1
- require 'opencv_ext'
1
+ require File.join(File.dirname(__FILE__), 'opencv_ext')
2
2
 
3
3
  module Paperclip
4
4
  class FaceCrop < Paperclip::Thumbnail
@@ -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.3"
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
- - 3
9
- version: 0.0.3
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