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:
parent
ec81c29453
commit
8718d1ef96
1 changed files with 16 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue