Sha256: 91de5f8bcfad9a2576694efd3b8490dd8c1496af1d5778a9df5234365e1e3b7b
Contents?: true
Size: 422 Bytes
Versions: 6
Compression:
Stored size: 422 Bytes
Contents
require 'mini_magick' module Thumbs class Resize def initialize(app) @app = app end def call(env) status, headers, body = @app.call(env) if env['thumbs.size'] begin thumb = MiniMagick::Image.read(body) thumb.resize env['thumbs.size'] body = thumb.to_blob rescue end end [status, headers, body] end end end
Version data entries
6 entries across 6 versions & 1 rubygems