diff --git a/app/models/post/image_uploader.rb b/app/models/post/image_uploader.rb index 44fb416..ea16ad0 100644 --- a/app/models/post/image_uploader.rb +++ b/app/models/post/image_uploader.rb @@ -1,8 +1,24 @@ # Una clase que permite adjuntar imágenes a artículos class Post::ImageUploader < CarrierWave::Uploader::Base + include CarrierWave::MiniMagick attr_accessor :site + process :strip + process resize_to_limit: [1280, 1280] + + version :thumb do + process :strip + process resize_to_fit: [200,200] + end + + def strip + manipulate! do |img| + img.strip + img + end + end + # Necesitamos pasar el sitio para poder acceder a los archivos locales def initialize(site, wtf = nil) super