diff options
author | Go MAEDA <maeda@farend.jp> | 2021-04-20 02:07:34 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-04-20 02:07:34 +0000 |
commit | 180a6616463e9cd4de54080202eed498fd6ee007 (patch) | |
tree | 100332769ee9bcf5918ea9f9bec9c368f29746d8 | |
parent | 9e78df79ccb63139a518a40f73a75775041eef28 (diff) | |
download | redmine-180a6616463e9cd4de54080202eed498fd6ee007.tar.gz redmine-180a6616463e9cd4de54080202eed498fd6ee007.zip |
Merged r20862 from trunk to 4.0-stable (#34969).
git-svn-id: http://svn.redmine.org/redmine/branches/4.0-stable@20953 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | lib/redmine/thumbnail.rb | 3 |
2 files changed, 2 insertions, 3 deletions
@@ -9,7 +9,7 @@ gem "request_store", "1.0.5" gem "mini_mime", "~> 1.0.1" gem "actionpack-xml_parser" gem "roadie-rails", "~> 1.3.0" -gem "mimemagic" +gem 'marcel' gem "mail", "~> 2.7.1" gem "csv", "~> 3.0.1" if RUBY_VERSION >= "2.3" && RUBY_VERSION < "2.6" diff --git a/lib/redmine/thumbnail.rb b/lib/redmine/thumbnail.rb index 0ced54208..29ec0828e 100644 --- a/lib/redmine/thumbnail.rb +++ b/lib/redmine/thumbnail.rb @@ -16,7 +16,6 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. require 'fileutils' -require 'mimemagic' module Redmine module Thumbnail @@ -30,7 +29,7 @@ module Redmine return nil unless convert_available? unless File.exists?(target) # Make sure we only invoke Imagemagick if the file type is allowed - unless File.open(source) {|f| ALLOWED_TYPES.include? MimeMagic.by_magic(f).try(:type) } + unless File.open(source) {|f| ALLOWED_TYPES.include? Marcel::MimeType.for(f) } return nil end directory = File.dirname(target) |