imagemagick - Rails, Paperclip: Downsizing image minimum amount such that one dimension matches geometry -
i'm using paperclip in rails project resize important image , have tried following:
has_attached_file :attachment, :styles => { :medium => ['640x480>', :jpg] } has_attached_file :attachment, :styles => { :medium => ['640x480^#', :jpg] } i'd downsize image minimum amount necessary height=640 or width=480. instance source image 1920x1080 resized 853x480, , source image 1080x1920 resized 640x1137. none of geometry arguments listed in imagemagick documentation seem have desired effect.
is there geometry argument accomplish resizing desire? if not, how might best accomplished?
as posted in comments fill flag (^) mark needs. flag used resize image based on smallest fitting dimension. is, image resized fill (and overflow) pixel area given. code should changed this:
has_attached_file :attachment, :styles => { :medium => ['640x480^', :jpg] } documentation flag can found here: http://www.imagemagick.org/usage/resize/#fill.
Comments
Post a Comment