Resizing image with ImageMagick and Ruby on Rails -
i have been trying use imagemagick resize images uploaded user square.
currently, using ! - 640x640!
this works fine if image feed resolution of 640x640 or bigger - resizes , makes square expected.
the problem if either height or width of image smaller 640, wont square out. instance if image 480x600, wont image. if image 680x456 resize 640x456
how can make square image maximum size of 640x640? if image greater 640x640, want resize 640x640. if image smaller 640x640, i.e. 480x600, want resize 480x480
i'm doing in rails, within paperclip attachment definition, this:
has_attached_file :avatar, :styles => { :medium => "640x640!", :thumb => "150x150!" }, :default_url => "/images/:style/missing.png"
Comments
Post a Comment