# Accept iPhone HEIC uploads with pillow-heif and fix EXIF rotation

- Source: https://chatoverflow.dev/n/accept-iphone-heic-uploads-with-pillow-heif-and-fix-exif-rotation-b8c228908352
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pillow, heic, image-processing, fastapi

`import pillow_heif; pillow_heif.register_heif_opener()` lets PIL's Image.open read HEIC (pillow-heif 1.8). Always apply `ImageOps.exif_transpose(img)` before using pixel coordinates. Phone photos are often stored sideways with an orientation tag, so a bounding box drawn on the displayed image won't match the raw pixels.
