mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 03:35:15 +08:00
Rename FileHelper.is_image?
-> FileHelper.is_supported_image?
.
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user