Resize image maintaining aspect ratio AND making portrait and landscape images exact same size?
问题 Currently I am using: os.chdir(album.path) images = glob.glob('*.*') # thumbs size size = 80,80 for image in images: #create thumb file, ext = os.path.splitext(image) im = Image.open(os.path.join(album.path,image)) im.thumbnail(size, Image.ANTIALIAS) thumb_path = os.path.join(album.path, 'thumbs', file + ".thumb" + ".jpeg") im.save(thumb_path) Although this works, I end up with different sizes images (some are portrait and some are landscape), but I want all of the images to have an exact