From bbd2120b04d6729c47ad90cbc29065080d72d04c Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 20 Apr 2018 16:59:44 -0400 Subject: [PATCH] give some feedback that something is happening in downsize_uploads --- script/downsize_uploads.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/downsize_uploads.rb b/script/downsize_uploads.rb index 342b2ae24f3..9812ca7abf9 100644 --- a/script/downsize_uploads.rb +++ b/script/downsize_uploads.rb @@ -5,7 +5,11 @@ max_image_pixels = [ARGV[0].to_i, 1_000_000].max puts '', "Downsizing uploads size to no more than #{max_image_pixels} pixels" +count = 0 + Upload.where("lower(extension) in (?)", ['jpg', 'jpeg', 'gif', 'png', 'bmp', 'tif', 'tiff']).find_each do |upload| + count += 1 + print "\r%8d".freeze % count absolute_path = Discourse.store.path_for(upload) if absolute_path && FileHelper.is_image?(upload.original_filename) file = File.new(absolute_path) rescue nil