I am trying to create and save a thumbnail image when saving the original user image in the userProfile model in my project, below is my code:
userProfile
def s
The image.thumbnail() function will maintain the aspect ratio of the original image.
Use image.resize() instead.
UPDATE
image = image.resize(THUMB_SIZE, Image.ANTIALIAS) thumb_fn = fn + '-thumb' + ext tf = NamedTemporaryFile() image.save(tf.name, 'JPEG')