Reprocessing images in Carrierwave

Joseph Le Brech picture Joseph Le Brech · Jan 30, 2012 · Viewed 8.6k times · Source

Let's say my model has an image with :thumb and the client wants :tiny and :nano thumbnails.

How do I reprocess all the existing images using a rake task?

I've found a rake task that I thought would do it https://gist.github.com/777788 but it's giving me errors.

Answer

Mikhail Nikalyukin picture Mikhail Nikalyukin · Jan 30, 2012

According to the Carrerwave documentation you can use following commands:

Model.all.each do |model|
  model.image.recreate_versions!
end