-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
23 lines (17 loc) · 1.08 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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:
http://some-server.tld/some-path/x/y/base64-url/hmac
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