我正在尝试在Rails应用程序的图像上添加水印。水印是JPG时有效,而PNG则无效。
<% @photo = photo.variant(
combine_options: {
gravity: 'center',
resize: '770x578',
draw: 'image Over 0,0 0,0 "' + Property::WATERMARK_PATH.to_s + '"'
}
) %>
在模型中:
WATERMARK_PATH = Rails.root.join('app','assets', 'images', 'watermark.png')
谁能告诉我为什么会这样以及如何解决? 非常感谢。