Skip to main content
100%

On demand image resizing with node.js in

✓ Published0🌍 Public
XXXX
Last edited May 20, 2011
Created on Apr 6, 2012

This example demonstrates on-demand image resizing through a Node.js HTTP server. It shows how URL parameters define the target dimensions, with requests like `/image.jpg/100x50` triggering a resize operation. The server uses the `http` module to handle incoming requests and `child_process.spawn` to invoke ImageMagick’s `convert` command, piping the resulting JPEG stream directly back to the client via `res.writeHead` and `convert.stdout.pipe`. The code relies entirely on command-line tools rather than a JavaScript imaging library.

AI-generated description

Similar vizzes