user1175969
user1175969

Reputation: 570

Upload two versions of an image (compressed and uncompressed) using CarrierWave in Rails

I am using Carrierwave and S3 to store images uploaded by the user in my rails app.

I want to store 2 versions of the image - one is the original, uncompressed image and the other is its compressed version. How do I do that?

Upvotes: 0

Views: 38

Answers (1)

m3characters
m3characters

Reputation: 2290

You can add to your uploader:

version :name_of_your_version do
  process resize_to_fit: [200,200]
end

Inside the block you can pass whatever processes you want and these will be executed and saved on a version called name_of_your_version.

Upvotes: 2

Related Questions