ruby on rails - Paperclip Resize to fit a rectangular box -


i have rectangular image example 30x800 pixels

how can scale paperclip preserve aspect ratio 100x100 pixel image borders filling empty area ?

an example : http://www.imagemagick.org/usage/thumbnails/pad_extent.gif

  has_attached_file :image, :styles => { :thumb => "100x100>" },      :convert_options => {:thumb => "-gravity center -extent 100x100"} 

or not white background

  has_attached_file :image, :styles => { :thumb => "100x100>" },      :convert_options => {:thumb => "-background red -gravity center -extent 100x100"} 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -