Hello, I am facing an issue where image orientation is correctly displayed using the NextJS Image Component locally on my machine and then when I deploy to Netlify the images are rotated sometimes. I was thinking maybe it is not respecting the EXIF image orientation metadata.
I also deployed to Vercel and it is displaying correctly there which is weird.
I really love the Netlify platform and all its features it provides so hopefully there is some fix!! Thanks!
At the moment, I see 2 different images and they look same on both platforms. Is this resolved?
I am having the same problem. It appears to be something that Vercel does, but netlify doesnt?
It looks like some part of the image optimization / webpack process isn’t respecting some EXIF data that shows the image is rotated.
Is there a way to fix this without going in and manually rotating all my images?
Do you have a reproduction to share?
Interesting, thanks for sharing. We’ll discuss this with the devs.
I tried adding an attribute as per this S/O thread and the images displayed in a way that looked less broken, but they were still not rotated / displaying sideways not as intended.
Thanks for checking.
This is already on our radar and the developers are working on determining the cause. As a matter of fact, they were able to reproduce the issue in various scenarios, thanks to the reproduction you shared, but the actual source of the issue is still unknown.
The source of the issue is google photos doing rotation operations and saving that info via EXIF data instead of ACTUALLY rotating the image and modifying the bitmap.
The photos I am using have been uplaoded to google photos by my phone. Then I go in and use google photos editing features, which lets me rotate them to be displayed correctly (in google photos, and on my desktop when I view images with Preview app).
APPARENTLY this is being done via EXIF data, and some part of the tag optimization process does not respect this. My only solution now is to go in and edit each photo individually, effectively re-exporting the bitmaps as new images that no longer have EXIF data indicating rotation.
- Upload photo to google photos
- Edit photo in google photos, rotate image
- Download photo to desktop
- Use photo in a next.js site locally (displays correctly)
- Deploy site to netlify
- Photo displays without correct rotation
Thank you for the details. We’ve passed it on to the devs.
Hey all, this appears to be an upstream issue: Support auto-rotation based on EXIF data · Issue #81 · unjs/ipx · GitHub. Once that’s closed, I believe the functionality would be available on Netlify too after some time.