config/initializers/dragonfly.rb in alchemy_cms-5.2.5 vs config/initializers/dragonfly.rb in alchemy_cms-5.2.6
- old
+ new
@@ -1,11 +1,19 @@
# frozen_string_literal: true
require "dragonfly_svg"
+require "alchemy/dragonfly/processors/crop_resize"
# Logger
Dragonfly.logger = Rails.logger
# Add model functionality
if defined?(ActiveRecord::Base)
ActiveRecord::Base.extend Dragonfly::Model
ActiveRecord::Base.extend Dragonfly::Model::Validations
+end
+
+# Dragonfly 1.4.0 only allows `quality` as argument to `encode`
+Dragonfly::ImageMagick::Processors::Encode::WHITELISTED_ARGS << "flatten"
+
+Rails.application.config.after_initialize do
+ Dragonfly.app(:alchemy_pictures).add_processor(:crop_resize, Alchemy::Dragonfly::Processors::CropResize.new)
end