RoR - Paperclip - How to set minimal width of an attachement

Posted by sNiCKY on Stack Overflow See other posts from Stack Overflow or by sNiCKY
Published on 2010-04-17T02:09:43Z Indexed on 2010/04/17 2:13 UTC
Read the original article Hit count: 279

Hi, my layout's requirement is to keep all thumbnails at 80px height, not higher, not smaller. In my model I set the style to :thumb=> "500x80>", so basically almost every picture which is not too wide gets its perfect miniature with 80px height. Sometimes, however, my pictures are narrow and high, so the thumb can have unclickable dimensions of like 5x80. So I dont want to crop pictures as long as thumbnails are not getting crazy narrow, but I think I can make a little sacrifice and crop them if thumb's width is getting smaller than 25px.

So my questions is - is it possible in paperclip to set minimal proportions of a picture by which the style will be "500x80>" and beyond that it will turn to sth like "25x80#"?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about paperclip