我想通过让imagemagick为所有缩略图应用阴影来改变paperclip中的缩略图处理方式。 我卡在的是实际的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,非常需要帮助。