summaryrefslogtreecommitdiffstats
path: root/lib/redmine
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-03-31 08:59:26 +0000
committerGo MAEDA <maeda@farend.jp>2021-03-31 08:59:26 +0000
commit38c29d8956627fddec8f65cdb10c100b11cdcf14 (patch)
tree2b697ca361d95e316a2cb23ed9717659040cfe86 /lib/redmine
parentde07a2ab3728c5a3207f73ec441f494395de3872 (diff)
downloadredmine-38c29d8956627fddec8f65cdb10c100b11cdcf14.tar.gz
redmine-38c29d8956627fddec8f65cdb10c100b11cdcf14.zip
Merged r20862 from trunk to 4.1-stable (#34969).
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@20878 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r--lib/redmine/thumbnail.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/redmine/thumbnail.rb b/lib/redmine/thumbnail.rb
index f9db6c93f..2e506dc78 100644
--- a/lib/redmine/thumbnail.rb
+++ b/lib/redmine/thumbnail.rb
@@ -18,7 +18,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'fileutils'
-require 'mimemagic'
module Redmine
module Thumbnail
@@ -34,8 +33,7 @@ module Redmine
return nil if is_pdf && !gs_available?
unless File.exists?(target)
# Make sure we only invoke Imagemagick if the file type is allowed
- mime_type = File.open(source) {|f| MimeMagic.by_magic(f).try(:type) }
- return nil if mime_type.nil?
+ mime_type = File.open(source) {|f| Marcel::MimeType.for(f)}
return nil if !ALLOWED_TYPES.include? mime_type
return nil if is_pdf && mime_type != "application/pdf"