A simple javascript function to resize and crop images using HTML5 Canvas.