diff options
author | Ben Bodenmiller <bbodenmiller@hotmail.com> | 2013-05-15 00:41:33 -0600 |
---|---|---|
committer | Ben Bodenmiller <bbodenmiller@hotmail.com> | 2013-05-15 00:41:33 -0600 |
commit | fb4a38f6077a27ea14709641f7fbe1547f37c8d4 (patch) | |
tree | 4c2474b16b7d9f09771f03e8c47db5ef98ba96bc | |
parent | ac148c50b07e298ff3f54147bd3faa0485f7e0a1 (diff) | |
download | gitlab-ce-fb4a38f6077a27ea14709641f7fbe1547f37c8d4.tar.gz |
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
-rw-r--r-- | app/uploaders/attachment_uploader.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 |