On 08 Oct 2009, at 17:39, GG9 Rails wrote:

> 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


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to