Commit e36c0c14d5032354edf65fa9a85c13a5da582158

Authored by Dmitriy Zaporozhets
2 parents ac148c50 fb4a38f6

Merge pull request #3950 from bbodenmiller/patch-4

fixes #3115 and adds support for gif bmp & tiff images
Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
app/uploaders/attachment_uploader.rb
... ... @@ -8,12 +8,12 @@ class AttachmentUploader < CarrierWave::Uploader::Base
8 8 end
9 9  
10 10 def image?
11   - img_ext = %w(png jpg jpeg)
  11 + img_ext = %w(png jpg jpeg gif bmp tiff)
12 12 if file.respond_to?(:extension)
13   - img_ext.include?(file.extension)
  13 + img_ext.include?(file.extension.downcase)
14 14 else
15 15 # Not all CarrierWave storages respond to :extension
16   - ext = file.path.split('.').last
  16 + ext = file.path.split('.').last.downcase
17 17 img_ext.include?(ext)
18 18 end
19 19 rescue
... ...