Skip to content

Commit

Permalink
Merge pull request #1327 from mixandgo/master
Browse files Browse the repository at this point in the history
Check if file exists on disk before calling identify
  • Loading branch information
tvdeyen authored Nov 24, 2017
2 parents 0ed9f0f + 652abaf commit 814e75a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/alchemy/upgrader/three_point_four.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def store_image_file_format
pictures.find_each(batch_size: 100).with_index do |pic, i|
begin
puts " -> Reading file format of #{pic.image_file_name} (#{i + 1}/#{count})"
format = pic.image_file.identify('-ping -format "%m"')
format = pic.image_file.identify('-ping -format "%m"') if pic.image_file.file
pic.update_column('image_file_format', format.to_s.chomp.downcase)
converted_pics += 1
rescue Dragonfly::Job::Fetch::NotFound => e
Expand Down

0 comments on commit 814e75a

Please sign in to comment.