ruby on rails - Paperclip resize and crop to rectangle -
ruby on rails - Paperclip resize and crop to rectangle -
so expecting series of photos of different sizes , aspect ratios. want able shrink/stretch photo fit much can in 200x100 rectangle , crop rest not fit. want crop happen around center well. possible? confused imagemagick documentation.
thanks!
paperclip's #
alternative want: fit image maximally within specified dimensions crop excess gravity @ center.
example:
has_attached_file :photo, :styles => { :original => "200x100#" }
note: if want maintain original intact , generate additional cropped thumb, alter :original
key else, :thumb
.
reference: http://rdoc.info/github/thoughtbot/paperclip/paperclip/classmethods
ruby-on-rails ruby imagemagick paperclip
Comments
Post a Comment