_19def crop_image()::_19 im = Image.open('example.jpg')_19 width, height = im.size_19 if width > height:_19 left = int((width - height) / 2)_19 top = 0_19 right = width - left_19 bottom = height_19 crop = im.crop((left, top, right, bottom))_19 if height > width:_19 left = 0_19 top = int((height - width) / 2)_19 right = width_19 bottom = height-top_19 crop = im.crop((left, top, right, bottom))_19 # square_19 else:_19 return_19 crop.save('example.jpg')