I know this should be simple however I’m having a bit of a brain block.
I’m using paperclip for uploading profile images however it’s currently resizing and distorting them.
class User < ActiveRecord::Base
has_attached_file :profile_image,
styles: { square_50: "50x50" }
...
end
What I actually want it to do is to clip the images into the correct ratio then resize them to the desired size.
i.e. If my containing box is 200x200px and a 400x500px profile image is uploaded then I want it to have 50px cropped off the top and bottom (to make it 400x400px) and for it then to be resized to 200px x 200px.
What is the correct way to achieve this?
Try
:square => '200x200#'— that should give you the square image you’re looking for.