From fb4a38f6077a27ea14709641f7fbe1547f37c8d4 Mon Sep 17 00:00:00 2001 From: Ben Bodenmiller Date: Wed, 15 May 2013 00:41:33 -0600 Subject: 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 --- app/uploaders/attachment_uploader.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/uploaders') diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb index 200700b8810..960e71ef640 100644 --- a/app/uploaders/attachment_uploader.rb +++ b/app/uploaders/attachment_uploader.rb @@ -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 -- cgit v1.2.1