# The crop function looks like this:
from PIL import Image
from django.core.files.base import ContentFile
def cropper(original_image, crop_coords):
img_io = StringIO.StringIO()
original_image = Image.open(original_image)
cropped_img = original_image.crop((0, 0, 165, 165))
cropped_img.save(img_io, format='JPEG', quality=100)
img_content = ContentFile(img_io.getvalue(), 'img5.jpg')
return img_content