I use Paperclip 2.3.11 in my Rails 3 application, and I create thumbnails using:
:styles => { :thumb => "80x80#" }
However, if the picture is small, say 32x32, it is enlarged to fit thumbnail dimensions.
I would like to fix that by hacking Paperclip.
Unfortunately, I couldn’t find the relevant code that describes #‘s behavior.
Could you please point me to the right place in Paperclip code ?
Or, maybe there is a better solution ? I would like the thumbnails to be 80x80 unless the original picture is too small (in which case the thumbnail should be the same size as the original picture).
So,
#is an argument used by Paperclip to know whether or not you expect the pic to be cropped.It’s written here, through the
crop?method, itself looking atgeometry[-1,1]: basically the last character of the style you enter.You could then:
try what’s suggested by @David Sulc which seems ok regarding my previous explanation
dig further in Paperclip’s code and maybe rewrite
transformation_todefined here