From 180a6616463e9cd4de54080202eed498fd6ee007 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 20 Apr 2021 02:07:34 +0000 Subject: [PATCH] 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 --- Gemfile | 2 +- lib/redmine/thumbnail.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 6ebdedb4b..74331f9bc 100644 --- a/Gemfile +++ b/Gemfile @@ -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) -- 2.39.5