diff --git a/lib/paperclip.rb b/lib/paperclip.rb index a60993437..dd4bd9d01 100644 --- a/lib/paperclip.rb +++ b/lib/paperclip.rb @@ -64,8 +64,6 @@ require "mime/types" end -require 'mimemagic' -require 'mimemagic/overlay' require 'logger' require 'cocaine' diff --git a/lib/paperclip/content_type_detector.rb b/lib/paperclip/content_type_detector.rb index b98779551..9868823f1 100644 --- a/lib/paperclip/content_type_detector.rb +++ b/lib/paperclip/content_type_detector.rb @@ -60,18 +60,12 @@ def possible_types end def type_from_file_contents - type_from_mime_magic || type_from_file_command + type_from_file_command rescue Errno::ENOENT => e Paperclip.log("Error while determining content type: #{e}") SENSIBLE_DEFAULT end - def type_from_mime_magic - @type_from_mime_magic ||= File.open(@filepath) do |file| - MimeMagic.by_magic(file).try(:type) - end - end - def type_from_file_command @type_from_file_command ||= FileCommandContentTypeDetector.new(@filepath).detect diff --git a/paperclip.gemspec b/paperclip.gemspec index 4587fbaa1..bf2c5fe3b 100644 --- a/paperclip.gemspec +++ b/paperclip.gemspec @@ -28,7 +28,6 @@ Gem::Specification.new do |s| s.add_dependency('activesupport', '>= 4.2.0') s.add_dependency('cocaine', '~> 0.5.5') s.add_dependency('mime-types') - s.add_dependency('mimemagic', '~> 0.3.0') s.add_development_dependency('activerecord', '>= 4.2.0') s.add_development_dependency('shoulda')