Request http://127.0.0.1:8000/200/sammy-davis-jr.jpg, and it sends this image in width 200, regardless if this size existed earlier. The only requirement is that the original size image exists.
It the resized image already exists, it will be served directly. If not, it is created, cached and served.
Install node.js first: http://nodejs.org/#download
> git clone [email protected]:phillipoertel/resizing_image_server.js.git resizing_image_server
> cd resizing_image_server
> rake setup
This will set up the following structure:
`— images
|— originals
`— resized
|— 100
|— 200
> node resizing_image_server.js
Now point your browser to: http://127.0.0.1:8000/200/sammy-davis-jr.jpg
To add a new size, create a new directory below “resized”.
This is the only way you control which image sizes are available.
Sizes currently can only be URL- and filesystem neutral strings, but with a bit of escaping all Image Magick geometry strings (http://is.gd/cjcci) should be supportable. The geometry is passed on to Image Magick directly from the URL.
Stats for node version 0.1.96 on my local machine (OS X Intel Core 2 Duo 2.66GHz, 4GB RAM, SSD HD)
This is a proof of concept, consider it alpha software.