|
|
@@ -19,13 +19,18 @@ module Fotos
|
|
|
exif_date_str = asset.exif_date.strftime(Fotos::DATE_FORMAT)
|
|
|
|
|
|
dest_dir = File.join(@destination_path, exif_date_str)
|
|
|
- dest_path = File.join(dest_dir, asset.file_name)
|
|
|
-
|
|
|
# create destination dir if not already there
|
|
|
FileUtils.mkdir_p(dest_dir) unless Dir.exist?(dest_dir)
|
|
|
+
|
|
|
+ if asset.web_supported?
|
|
|
+ dest_path = File.join(dest_dir, asset.file_name)
|
|
|
+ FileUtils.cp(fp, dest_path)
|
|
|
+ elsif asset.heic?
|
|
|
+ target_file_name = [asset.file_base, '.JPG'].join
|
|
|
+ dest_path = File.join(dest_dir, target_file_name)
|
|
|
+ asset.image.write_to_file(dest_path)
|
|
|
+ end
|
|
|
puts "#{asset.file_name} --> #{dest_path}"
|
|
|
- FileUtils.cp(fp, dest_path)
|
|
|
- dest_path
|
|
|
end
|
|
|
end
|
|
|
end
|