Instagram Engineering Challenge: The Unshredder
Two days ago, a friend (@sittisal) shared, on Google+, this link: Instagram Engineering Challenge: The Unshredder.
In short, Instagram has launched a challenge to "write a simple script that takes a shredded image in as input and outputs an unshredded and reconstituted image".

I decided to try in my short spare time and here is my script demo. Since I thought to write a dynamic web demo application, I used HTML5 and javascript to be able to access pixel data in the image. So I needed no Imaging Library as PIL, RMagick, and GIL. My final algorithm comes to about 120 lines of uncompressed javascript code (not that embedded in this page ;) and it seems fast enough (the test image is decoded, after being downloaded, in almost one second). Surely the algorithm can still be optimized but, for the moment, that's okay.

* Max image width = max image height = 640px to avoid long waiting time.