提交 931fe37a 编写于 作者: G George Claghorn

Revert "Invoke mogrify once when transforming an image"

This reverts commit a80f81af.
上级 b9de7ea8
...@@ -44,15 +44,13 @@ def initialize(transformations) ...@@ -44,15 +44,13 @@ def initialize(transformations)
end end
# Accepts an open MiniMagick image instance, like what's returned by <tt>MiniMagick::Image.read(io)</tt>, # Accepts an open MiniMagick image instance, like what's returned by <tt>MiniMagick::Image.read(io)</tt>,
# and performs the +transformations+ against it. # and performs the +transformations+ against it. The transformed image instance is then returned.
def transform(image) def transform(image)
image.mogrify do |command| transformations.each do |(method, argument)|
transformations.each do |method, argument| if eligible_argument?(argument)
if eligible_argument?(argument) image.public_send(method, argument)
command.public_send(method, argument) else
else image.public_send(method)
command.public_send(method)
end
end end
end end
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册