Variable sizes with paperclip

How can i create variable sizes with paperclip.

That the user can set the size he want and paperclip makes the picture.
I only can create fixed sizes.

Probably adding the following to your model will work:

before_post_process :get_thumbnail_sizes

def get_thumbnail_sizes

  User.stamper.thumbnail_sizes.each do |target_size|

     asset.styles[] = { :geometry => target_size.geometry,   :format => "png", :processors => "thumbnail" }



User.stamper is something you can get by adding the Userstamp plugin ( to your project (to make it easy on yourself). There’s still a couple of things you’ll need to figure out yourself, but this should at least get you started.

Best regards

Peter De Berdt