lib/carrierwave/base64/base64_string_io.rb in carrierwave-base64-2.8.1 vs lib/carrierwave/base64/base64_string_io.rb in carrierwave-base64-2.9.0
- old
+ new
@@ -1,7 +1,6 @@
-require 'mimemagic'
-require 'mimemagic/overlay'
+require 'marcel'
module Carrierwave
module Base64
# Class that decodes a base64 string, builds a StringIO for the
# decoded bytes, and extracts the file MIME type to build a file
@@ -46,10 +45,10 @@
private
# Determine content type from input, with provided type as fallback
def get_file_extension(description, bytes)
- detected_type = MimeMagic.by_magic(bytes)
+ detected_type = Marcel::Magic.by_magic(bytes)
content_type = (detected_type && detected_type.type) ||
description.split(';base64').first
mime_type = MIME::Types[content_type].last
unless mime_type
raise Carrierwave::Base64::UnknownMimeTypeError,