I would like to crop an image to the size the user has selected from a list (e.g. 100x100px, 200x200px,...) How would I pass that attribute to the uploader or get the model's attribute from within the uploader?
Accessing the model's attribute from within the uploader as following does not work:
version :thumb do thumbnail_size = model.thumbnail_size ... ... end
I get following error:
undefined local variable or method `model' for #
Thank you! Florian
In order to be able to access the model's attribute I had to add a manipulation helper.
class MyUploader < CarrierWave::Uploader::Base
version :thumb do
process :convert => 'jpg'
width = model.get_image_width
height = model.get_image_height
manipulate! do |img|