def _make_image_square(source_image, side=settings.THUMBNAIL_SIZE):
 square_image = Image.new('RGBA', (side, side), (255, 255, 255, 0))
 width = ((side - source_image.size[0]) / 2)
 height = ((side - source_image.size[1]) / 2)
 square_image.paste(source_image, (width, height))
 return square_image

def _make_image_square ( source_image , side = settings . THUMBNAIL_SIZE ) : square_image = Image . new ( 'RGBA' , ( side , side ) , ( 255 , 255 , 255 , 0 ) ) width = ( ( side - source_image . size [ 0 ] ) / 2 ) height = ( ( side - source_image . size [ 1 ] ) / 2 ) square_image . paste ( source_image , ( width , height ) ) return square_image
pads a rectangular image with transparency to make it square .