Web service to safely resize most images. A re-implementation of the ultra-reliable StyleFeeder service that ran unattended for years.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is the guts of a webservice to resize images.  We used something very much like this at StyleFeeder to 
resize well over 40M images and had no troubles with it at all.  It takes pretty much any format and basically 
works unattended.  

We ran this on a cluster of EC2 boxes.  You can make the URLs friendlier using some basic Apache or Nginx rules:


Basically, you just need to provide four parameters to the script:

	1) width (x)
	2) height (y)
	3) a base64 encoded URL of the image you want to retrieve from the net and resize
	4) a HMAC key

The first few are easy.  The HMAC warrants some explanation.  When you have a service like this and you leave 
it wide open to the interwebs, fools may abuse it.  In order to prevent such menacing behavior, this script 
provides some protection by requiring the client that calls it to know a secret key.  The short story of why 
you do not rely on a basic sha1 or some such fingerprint is that you should not hash secrets.  Since the 
key is a secret, we use HMAC.  

Feb 9, 2012
Philip Jacob