Class: Services::ImagePreparator

Inherits:
Object
  • Object
show all
Defined in:
lib/services/image_preparator.rb

Instance Method Summary collapse

Constructor Details

#initialize(image_path, face_detection, safe_search) ⇒ ImagePreparator

Returns a new instance of ImagePreparator.



5
6
7
8
9
# File 'lib/services/image_preparator.rb', line 5

def initialize(image_path, face_detection, safe_search)
  @image_path = image_path
  @face_detection = face_detection
  @safe_search = safe_search
end

Instance Method Details

#callObject



18
19
20
21
22
# File 'lib/services/image_preparator.rb', line 18

def call
  image = MiniMagick::Image.open(@image_path)
  return @image_path unless oversized?(image)
  resize_image(image)
end