From 161a3c38706af771d8cce0a7484be4b12ce97526 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 26 Mar 2019 15:07:50 +0800 Subject: [PATCH] DEV: Don't optimize image when migrating to new scheme. The image has already been uploaded, the migrate to new scheme job's is just to correct the scheme and not the content of the upload. --- app/models/upload.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/upload.rb b/app/models/upload.rb index 8e1b312b9aa..fd3f3c86a2e 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -253,8 +253,7 @@ class Upload < ActiveRecord::Base if upload.sha1.blank? upload.sha1 = Upload.generate_digest(path) end - # optimize if image - FileHelper.optimize_image!(path) if FileHelper.is_supported_image?(File.basename(path)) + # store to new location & update the filesize File.open(path) do |f| upload.url = Discourse.store.store_upload(f, upload)