Folder # will do exactly what you want: fit the image as much as possible within the specified dimensions, then circle the excess with gravity in the center.
Example:
has_attached_file :photo, :styles => { :original => "200x100#" }
Note. . If you want to keep the original intact and create an extra cropped finger, simply change the :original key to something else, for example :thumb .
Link: http://rdoc.info/github/thoughtbot/paperclip/Paperclip/ClassMethods
source share