mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
give some feedback that something is happening in downsize_uploads
This commit is contained in:
parent
31c1c32b68
commit
bbd2120b04
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue