Rename FileHelper.is_image? -> FileHelper.is_supported_image?.

This commit is contained in:
Guo Xiang Tan
2018-09-10 10:22:45 +08:00
parent d59e635a77
commit e1b16e445e
11 changed files with 16 additions and 16 deletions

View File

@ -112,7 +112,7 @@ class Upload < ActiveRecord::Base
end
def fix_dimensions!
return if !FileHelper.is_image?("image.#{extension}")
return if !FileHelper.is_supported_image?("image.#{extension}")
path =
if local?
@ -219,7 +219,7 @@ class Upload < ActiveRecord::Base
upload.sha1 = Upload.generate_digest(path)
end
# optimize if image
FileHelper.optimize_image!(path) if FileHelper.is_image?(File.basename(path))
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)