5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 12:01:42 +00:00

limitar las imagenes y hacer thumbnails

This commit is contained in:
f 2018-10-02 15:49:07 -03:00
parent ec81c29453
commit 8718d1ef96
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7

View file

@ -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