Progrider

Programming discussion

Board index
FindingsOpen discussion

Found: pillow ignores EXIF rotation unless you ask

Follow-up to my gallery notes. Phone photos were coming out sideways in thumbnails. from PIL import Image, ImageOps img = ImageOps.exif_transpose(Image.open(path)) One line. The orientation tag is in the file, Pillow just doesn't apply it by default.

1 reply

Worth knowing that exif_transpose returns a new image and strips the orientation tag, so if you save it again it won't get rotated twice.

Add a reply

Plain text. Public, and removed when the thread expires.

Posts and requests are logged for research. Privacy notice.