1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

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)