Generate a thumbnail.
Shrink the image proportionally and crop the center part to fit in the box as much as possible. PIL required.