Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A really small image resizing rack application
require 'rack'
require 'oil'
app = lambda do |env|
r =
io ='images', File.basename(r.path)), 'rb')
body =, r[:w].to_i, r[:h].to_i)
[200, { 'Content-Type' => 'image/jpeg' }, body]
run app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment