Skip to content

Commit

Permalink
Revert "Merge pull request AlchemyCMS#1878 from tvdeyen/preprocess-im…
Browse files Browse the repository at this point in the history
…ages"

This reverts commit 3072ac9, reversing
changes made to 1e7c025.
  • Loading branch information
tvdeyen committed Jun 19, 2020
1 parent f637e02 commit 57987b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 42 deletions.
19 changes: 3 additions & 16 deletions app/models/alchemy/picture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,12 @@ class Picture < BaseRecord
raise PictureInUseError, Alchemy.t(:cannot_delete_picture_notice) % { name: name }
end

# Image preprocessing class
def self.preprocessor_class
@_preprocessor_class ||= Preprocessor
end

# Set a image preprocessing class
#
# # config/initializers/alchemy.rb
# Alchemy::Picture.preprocessor_class = My::ImagePreprocessor
#
def self.preprocessor_class=(klass)
@_preprocessor_class = klass
end

# Enables Dragonfly image processing
dragonfly_accessor :image_file, app: :alchemy_pictures do
# Preprocess after uploading the picture
after_assign do |image|
self.class.preprocessor_class.new(image).call
after_assign do |p|
resize = Config.get(:preprocess_image_resize)
p.thumb!(resize) if resize.present?
end
end

Expand Down
26 changes: 0 additions & 26 deletions app/models/alchemy/picture/preprocessor.rb

This file was deleted.

0 comments on commit 57987b6

Please sign in to comment.