Class: PhotoFlick::ImageProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/photo_flick/image_processor.rb

Overview

This class responsible for creating collage using ImageMagick.

Instance Method Summary collapse

Constructor Details

#initialize(output_file) ⇒ ImageProcessor

Returns a new instance of ImageProcessor.



6
7
8
# File 'lib/photo_flick/image_processor.rb', line 6

def initialize(output_file)
  @output_file = output_file
end

Instance Method Details

#create_collage!Object



10
11
12
13
14
15
16
17
# File 'lib/photo_flick/image_processor.rb', line 10

def create_collage!
  Dir[Dir.pwd + "/tmp/*.jpg"].each do |f|
    image = resize_images(f)
    image.format 'jpg'
    image.write "tmp/#{File.basename(f)}"
  end
  build_montage
end