Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

paperclip image size notations

At the beginning it seemed to me a like a mistype but now as I see more examples I realize its not..

I see :thumb => "300x300>"

or :thumb => "100x100#"

and even :thumb => "180"

what do these mean? Where can I find explanation for that notation?

like image 696
Nick Ginanto Avatar asked Nov 08 '12 10:11

Nick Ginanto


1 Answers

On the git repository where it is developed. Explanation copied from there:

Resizing options

Default behavior is to resize the image and maintain aspect ratio (i.e. the :medium version of a 300×150 image will be 200×100). Some commonly used options are:

  • trailing #, thumbnail will be centrally cropped, ensuring the requested dimensions.
  • trailing >, thumbnail will only be modified if it is currently larger requested dimensions. (i.e. the :small thumb for a 120×80 original image will be unchanged)
like image 180
Matzi Avatar answered Nov 01 '22 02:11

Matzi