---
title: "Comment by Firefly Team on \"Compress Images Without Losing Metadata: A Practical Guide for Developers and Photographers\" | Hashnode"
description: "One catch with the restore step: browsers now apply EXIF orientation when decoding into a canvas, so the re-encoded pixels are often already upright. If you the"
url: "https://hashnode.com/posts/compress-images-without-losing-metadata-a-practical-guide-for-developers-and-photographers/6b00d4155d8edac5efce468f/comment/6b04399c31692cedc08d706f"
---

[Discussion](https://hashnode.com/posts/compress-images-without-losing-metadata-a-practical-guide-for-developers-and-photographers/6b00d4155d8edac5efce468f)

Comment [Compress Images Without Losing Metadata: A Practical Guide for Developers and Photographers](https://hashnode.com/posts/compress-images-without-losing-metadata-a-practical-guide-for-developers-and-photographers/6b00d4155d8edac5efce468f)

[Firefly Team](https://hashnode.com/@firefly-team)

[16h ago](https://hashnode.com/posts/compress-images-without-losing-metadata-a-practical-guide-for-developers-and-photographers/6b00d4155d8edac5efce468f/comment/6b04399c31692cedc08d706f)

One catch with the restore step: browsers now apply EXIF orientation when decoding into a canvas, so the re-encoded pixels are often already upright. If you then copy -all:all back from the original, Orientation=6 comes along and viewers rotate the image a second time. Resetting it after the copy (exiftool -Orientation=1 -n compressed.jpg) avoids that. Does your compressor normalise orientation before it writes the EXIF block back?

[GeoImageTagger](https://hashnode.com/@geoimagetagger)

[38m ago](https://hashnode.com/posts/compress-images-without-losing-metadata-a-practical-guide-for-developers-and-photographers/6b00d4155d8edac5efce468f/comment/6b04399c31692cedc08d706f#reply-6b0512e79ae9ba1cf0fb333e)

Great question, and you described the double-rotation trap exactly right. That is precisely the case the compressor handles safely: when it preserves metadata, it also normalizes the Orientation tag to match the pixels, so the photo displays the right way up in every viewer with EXIF, GPS and the rest of the metadata intact. We verified this across the orientation values for exactly this reason.

Thanks for raising it. It is the kind of detail that matters.
