---
title: "Comment by Adam Lewis on \"Why Phone Photos Turn Sideways in Your jsPDF Output (and a Small Fix)\" | Hashnode"
description: "You get a rotated image with no error to chase because drawImage respects the source orientation but the page transform ignores it. EXIF is input to normalise r"
url: "https://hashnode.com/posts/why-phone-photos-turn-sideways-in-your-jspdf-output-and-a-small-fix/6ac6afbe052ee503d6641a06/comment/6acb4e099d64693c6e3bca75"
---

[Discussion](https://hashnode.com/posts/why-phone-photos-turn-sideways-in-your-jspdf-output-and-a-small-fix/6ac6afbe052ee503d6641a06)

Comment [Why Phone Photos Turn Sideways in Your jsPDF Output (and a Small Fix)](https://hashnode.com/posts/why-phone-photos-turn-sideways-in-your-jspdf-output-and-a-small-fix/6ac6afbe052ee503d6641a06)

[Adam Lewis](https://hashnode.com/@nark3d)

[Oct 11](https://hashnode.com/posts/why-phone-photos-turn-sideways-in-your-jspdf-output-and-a-small-fix/6ac6afbe052ee503d6641a06/comment/6acb4e099d64693c6e3bca75)

You get a rotated image with no error to chase because drawImage respects the source orientation but the page transform ignores it. EXIF is input to normalise rather than metadata to preserve: read the tag, bake the rotation into the bitmap or the transform matrix, then let the export forget it ever existed. EXIF-orientation libraries exist for exactly this and they hand you a canvas you can draw straight into jsPDF. The resize and the re-encode tend to drop the tag on the way through, which is why the fix has to happen after the image is decoded rather than before.
