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[target_size.name] = { :geometry => target_size.geometry,   :format => "png", :processors => "thumbnail" }

  end

end

User.stamper is something you can get by adding the Userstamp plugin (http://github.com/delynn/userstamp) 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