【发布时间】:2009-07-22 20:16:50
【问题描述】:
我想通过让 imagemagick 对所有缩略图应用投影来更改回形针中缩略图的处理。我坚持的是实际的 imagemagick 命令,它将拉开这个小奇迹。我尝试过的所有操作都会返回一个不正确缩放的阴影,而没有原始图像。
def transformation_command
scale, crop = @current_geometry.transformation_to(@target_geometry, crop?)
trans = ""
trans << " -resize \"#{scale}\""
trans << " -crop \"#{crop}\" +repage" if crop
# Apply Drop Shadow
trans << " #{convert_options}" if convert_options?
trans
end
我试过的一个...
def transformation_command
scale, crop = @current_geometry.transformation_to(@target_geometry, crop?)
trans = ""
trans << " -resize \"#{scale}\""
trans << " -crop \"#{crop}\" +repage" if crop
trans << " \( +clone -background black -shadow 60x5+10+10 \) +swap -background none -layers merge +repage"
trans << " #{convert_options}" if convert_options?
trans
end
我是 imagemagick 的新手,任何帮助将不胜感激。
【问题讨论】:
标签: ruby-on-rails ruby imagemagick paperclip