Does the '#' modifier for cropping images in Paperclip work only for square images?

Posted by user3451384 on Stack Overflow See other posts from Stack Overflow or by user3451384
Published on 2014-08-23T04:14:56Z Indexed on 2014/08/23 4:20 UTC
Read the original article Hit count: 110

Filed under:
|
|

It is very well documented that you can create square thumbnails with center cropping with Paperclip (4) and Rails (4).

I would like to have an image of very specific dimensions (e.g. 200x100) and if input an image of let's say 800x200 it is first resized to 400x100 and then the width (400) is cropped down to 200 pixel from the center (i.e. 100px cut from the right and 100 px cut from the left).

I tried with 200x100# and it does not appear to work (i.e. the '#' has no effect).

I have found that I could adapt other solutions such as this, but I was wondering if '#' is supposed to work only for cropping to square images, or is a Paperclip bug or I am doing something wrong...

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about image