Merge pull request #3950 from bbodenmiller/patch-4

fixes #3115 and adds support for gif bmp & tiff images
This commit is contained in:
Dmitriy Zaporozhets 2013-05-15 03:57:19 -07:00
commit e36c0c14d5

View file

@ -8,12 +8,12 @@ class AttachmentUploader < CarrierWave::Uploader::Base
end
def image?
img_ext = %w(png jpg jpeg)
img_ext = %w(png jpg jpeg gif bmp tiff)
if file.respond_to?(:extension)
img_ext.include?(file.extension)
img_ext.include?(file.extension.downcase)
else
# Not all CarrierWave storages respond to :extension
ext = file.path.split('.').last
ext = file.path.split('.').last.downcase
img_ext.include?(ext)
end
rescue