Reputation: 23395
I have an Image model with the following two styles:
:original => ['500x400!'],
:thumb => ['75x54!',:jpg]
The last style, :thumb, I have just modified the dimensions of to make thubnails larger.
This works great for new images uploaded by users but I'm not sure how to have paperclip loop through all my existing thumbnail images and resize them.
Hoping someone can give some advice about how this to this.
Thanks!
Upvotes: 4
Views: 877
Reputation: 1793
There is a rake task for that:
rake paperclip:refresh:thumbnails CLASS=YourModel
To be more in control you could also manually reprocess thumbnails for specific instances:
some_model_instances.each do |instance|
instance.photo.reprocess!
end
Upvotes: 7
Reputation: 9605
Paperclip comes with a rake task that does exactly this:
rake paperclip:refresh RAILS_ENV=production CLASS=Photo
In this example, the above will re-generate all attachments belonging to the Photo class.
Upvotes: 4