diaspora/app/uploaders/image_uploader.rb
2010-07-23 14:53:12 -07:00

29 lines
512 B
Ruby

class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
storage :grid_fs
def store_dir
"files/#{model.id}"
end
def extension_white_list
%w(jpg jpeg gif png)
end
version :thumb_small do
process :resize_to_fill => [30,30]
end
version :thumb_medium do
process :resize_to_fill => [100,100]
end
version :thumb_large do
process :resize_to_fill => [300,200]
end
version :scaled_full do
process :resize_to_limit => [700,700]
end
end