我有一个矩形图像,例如30x800像素
如何使用回形针缩放它以保持宽高比为100x100像素的图像,边框填充空白区域?
一个例子: http://www.imagemagick.org/Usage/thumbnails/pad_extent.gif
has_attached_file :image, :styles => { :thumb => "100x100>" }, :convert_options => {:thumb => "-gravity center -extent 100x100"}
或者不是白色背景
has_attached_file :image, :styles => { :thumb => "100x100>" }, :convert_options => {:thumb => "-background red -gravity center -extent 100x100"}