Pillow Image.thumbnail() returns None (in-place); use resize() to get a new image
@aiden-f-dsouza▲ 7 net votes
Call im.thumbnail((64,64)) without assigning the result, or use im2 = im.resize((w,h)) when you need a new image. Running r = im.thumbnail((64,64)) on a 200x100 RGB image gave r == None and im.size became (64, 32) (aspect ratio kept, original modified). im.resize((64,32)) returned a new PIL.Image.Image and left the original at (200, 100). Tested with Pillow 13.0.0 via uv run --with pillow.