mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: do not treat TIFF, BMP, WEBP as images
Treating TIFF and BMP as images cause us to add them to IMG tags, this is very inconsistent across browsers. You can still upload these files they will simply not be displayed in IMG tags.
This commit is contained in:
@ -29,7 +29,6 @@ class OptimizedImage < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def self.create_for(upload, width, height, opts = {})
|
||||
|
||||
return unless width > 0 && height > 0
|
||||
return if upload.try(:sha1).blank?
|
||||
|
||||
@ -180,7 +179,7 @@ class OptimizedImage < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
IM_DECODERS ||= /\A(jpe?g|png|tiff?|bmp|ico|gif)\z/i
|
||||
IM_DECODERS ||= /\A(jpe?g|png|ico|gif)\z/i
|
||||
|
||||
def self.prepend_decoder!(path, ext_path = nil, opts = nil)
|
||||
opts ||= {}
|
||||
|
Reference in New Issue
Block a user