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:
Penar Musaraj
2019-02-11 00:28:43 -05:00
committed by Sam
parent 84a10f8212
commit c50db76f5d
6 changed files with 18 additions and 23 deletions

View File

@ -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 ||= {}