我一直试图将一个图像叠加在另一个图像上并遇到问题。
运行方法后,仅显示第一张图像。我无法弄清楚原因。
version :final_product do
process :frame_photo
end
def frame_photo
second_image = MiniMagick::Image.open("http://s3-us-west-2.amazonaws.com/luminoto-modal/4x5-cream-blue.jpg")
manipulate! do |img|
result = img.composite(second_image) do |c|
c.compose "Over" # OverCompositeOp
c.gravity "Center" # copy second_image onto first_image from (20, 20)
end
result
end
end