From 931fe37aa78b9af9f779ac750cf2fa132e049c2b Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Mon, 11 Dec 2017 18:30:21 -0500 Subject: Revert "Invoke mogrify once when transforming an image" This reverts commit a80f81af055f02bf4625c90470aa90441cf6fc24. --- activestorage/app/models/active_storage/variation.rb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/activestorage/app/models/active_storage/variation.rb b/activestorage/app/models/active_storage/variation.rb index 6a8825f1a8..13bad87cac 100644 --- a/activestorage/app/models/active_storage/variation.rb +++ b/activestorage/app/models/active_storage/variation.rb @@ -44,15 +44,13 @@ class ActiveStorage::Variation end # Accepts an open MiniMagick image instance, like what's returned by MiniMagick::Image.read(io), - # and performs the +transformations+ against it. + # and performs the +transformations+ against it. The transformed image instance is then returned. def transform(image) - image.mogrify do |command| - transformations.each do |method, argument| - if eligible_argument?(argument) - command.public_send(method, argument) - else - command.public_send(method) - end + transformations.each do |(method, argument)| + if eligible_argument?(argument) + image.public_send(method, argument) + else + image.public_send(method) end end end -- cgit v1.2.3