|
|
@@ -7,6 +7,7 @@ module Fotos
|
|
|
|
|
|
def initialize(options)
|
|
|
@source_dir = Fotos::SourceDirectory.new(options[:source])
|
|
|
+ @generate_thumbnails = options[:thumbnails]
|
|
|
end
|
|
|
|
|
|
def call
|
|
|
@@ -16,6 +17,10 @@ module Fotos
|
|
|
if File.exist?(file.thumbnail_path)
|
|
|
puts "<a href=\"#{file.dir_name}/#{file.file_name}\"><img src=\"#{file.thumbnail_path}\" /></a>"
|
|
|
else
|
|
|
+ if @generate_thumbnails
|
|
|
+ Fotos::Thumbnail.new(file.file_path).create
|
|
|
+ redo
|
|
|
+ end
|
|
|
puts "<a href=\"#{file.dir_name}/#{file.file_name}\"><img src=\"#{file.file_path}\" /></a>"
|
|
|
end
|
|
|
end
|