Don't swallow LoadError raised for missing libvips

上级 151167eb
......@@ -105,10 +105,14 @@ def mini_magick_transform(file, format)
# Returns the ImageProcessing processor class specified by `ActiveStorage.variant_processor`.
def processor
require "image_processing"
begin
require "image_processing"
rescue LoadError
ActiveSupport::Deprecation.warn("Using mini_magick gem directly is deprecated and will be removed in Rails 6.1. Please add `gem 'image_processing', '~> 1.2'` to your Gemfile.")
return nil
end
ImageProcessing.const_get(ActiveStorage.variant_processor.to_s.camelize) if ActiveStorage.variant_processor
rescue LoadError
ActiveSupport::Deprecation.warn("Using mini_magick gem directly is deprecated and will be removed in Rails 6.1. Please add `gem 'image_processing', '~> 1.2'` to your Gemfile.")
end
def pass_transform_argument(command, method, argument)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册