Skip to content

Instantly share code, notes, and snippets.

@christianrojas
Created February 22, 2010 19:21
Show Gist options
  • Save christianrojas/311375 to your computer and use it in GitHub Desktop.
Save christianrojas/311375 to your computer and use it in GitHub Desktop.
require 'rmagick'
require 'soporte/formato'
class Imagen
include Magick
def hacer_thumbnail(ruta_original, ruta_thumbnail, ano, mes, dia, nombre)
formato = Formato.new
imagen_original = ImageList.new("#{ruta_original}#{ano}/#{formato.agregar_cero(mes)}/#{formato.agregar_cero(dia)}/#{nombre}")
imagen_thumbnail = imagen_original.thumbnail(0.15)
imagen_thumbnail.write("#{ruta_thumbnail}#{ano}/#{formato.agregar_cero(mes)}/#{formato.agregar_cero(dia)}/#{nombre}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment