Don't swallow LoadError raised for missing libvips

This commit is contained in:
Janko Marohnić 2018-04-23 22:07:50 +02:00
parent 151167eb3d
commit f2e2cef15b
No known key found for this signature in database
GPG Key ID: 84166B4FB1C84F3E
1 changed files with 7 additions and 3 deletions

View File

@ -105,10 +105,14 @@ class ActiveStorage::Variation
# 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)