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
This commit is contained in:
Go MAEDA
2021-04-20 02:07:34 +00:00
parent 9e78df79cc
commit 180a661646
2 changed files with 2 additions and 3 deletions

View File

@@ -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"

View File

@@ -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)