diff --git a/lib/paperclip/attachment.rb b/lib/paperclip/attachment.rb index a9b25da..4d06464 100644 --- a/lib/paperclip/attachment.rb +++ b/lib/paperclip/attachment.rb @@ -414,7 +414,7 @@ module Paperclip end def post_process #:nodoc: - return unless content_type.match(/image/) + return if !content_type.include?('image') || content_type.include?('svg') return if queued_for_write[:original].nil? instance.run_paperclip_callbacks(:post_process) do diff --git a/lib/paperclip/upfile.rb b/lib/paperclip/upfile.rb index 1b16e0e..a4a1e3d 100644 --- a/lib/paperclip/upfile.rb +++ b/lib/paperclip/upfile.rb @@ -20,6 +20,7 @@ module Paperclip when %r"html?" then "text/html" when "csv", "xml", "css", "js" then "text/#{type}" when "liquid" then "text/x-liquid" + when 'svg' then 'image/svg+xml' else "application/x-#{type}" end end