summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-03-27 10:23:47 +0000
committerGo MAEDA <maeda@farend.jp>2021-03-27 10:23:47 +0000
commite6a8529ba8c60b344e56605c1f430c9c3771ef8e (patch)
treecac61246d08df37253f72ce4d010e99740d63953 /lib
parent3a962fe36549588284eb1c3b126789a193702cad (diff)
downloadredmine-e6a8529ba8c60b344e56605c1f430c9c3771ef8e.tar.gz
redmine-e6a8529ba8c60b344e56605c1f430c9c3771ef8e.zip
Replace MimeMagic with Marcel (#34969).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@20862 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-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 53a0f5350..4bee4085a 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
@@ -35,8 +34,7 @@ module Redmine
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"