Why does a photo rotate after uploading?
Some photos store an orientation instruction separately from their pixel data. Different handling of that instruction can make the same file appear rotated or mirrored.
Orientation is stored separately


Both files store the same 320 × 200 pixels. Orientation 6 tells the browser to rotate them 90° clockwise, so the arrow points right and the displayed size becomes 200 × 320.
Settings and measurements
| File | Dimensions | Bytes | Export settings |
|---|---|---|---|
| orientation-1.jpg | 320 × 200 | 8,068 | Quality: 95, Subsampling: 0 |
| orientation-6.jpg | 320 × 200 | 8,068 | Quality: 95, Subsampling: 0 |
Python 3.14.4, Pillow 13.0.0, Platform Linux, Webp 1.6.0, Jpeg 6.2, Avif 1.4.2
Save a correctly oriented copy
Use an editor that displays the original correctly. Apply the orientation to the pixels, then export with a normal orientation tag or no orientation tag. Check the new file before sending it.
Avoid a second rotation
Do not rotate the pixels manually and leave an instruction that rotates them again. Also avoid guessing from a filename or thumbnail.
The image information tool shows the stored pixel dimensions. For JPEG files with a recognized orientation tag, it also shows the orientation and any resulting change in displayed dimensions.
Related guides
Sources
- ExifTool project: EXIF tags
- MDN: createImageBitmap