Commit fb4a38f6077a27ea14709641f7fbe1547f37c8d4

Authored by Ben Bodenmiller
1 parent ac148c50

fixes #3115 and adds support for gif bmp & tiff images

when showing image preview check via lowercased extension 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
... ...