我正在尝试通过carrierwave和mini_magic将文本放在图像上。代码运行没有错误,但生成的图像上没有文字。
version :text do
process :put_text_stamp
end
def put_text_stamp
manipulate! do |img|
img.combine_options do |c|
c.gravity 'Center'
c.fill 'red'
c.pointsize '22'
c.draw "text 0,0 'TEXT'"
end
img = yield(img) if block_given?
img
end
end