Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Carrierwave resize existing image

I have a rails 3 application which uses the CarrierWave gem. Until now, I have uploaded my pictures in 48*48 and 100*100 but now I would like to store them in 200*200.

Is there a way to resize my already uploaded images ?

like image 754
Jérémy Pouyet Avatar asked Oct 25 '13 14:10

Jérémy Pouyet


1 Answers

Yes, you have to add you new version to the image uploader...

version :thumb do
  process :resize_to_fill => [200,200]
end

...and then recreate them:

User.all.each do |user|
  user.avatar.recreate_versions!
end

See carrierwave's readme.

like image 86
cortex Avatar answered Nov 02 '22 23:11

cortex