immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
51.84k stars 2.74k forks source link

[BUG] Incorrect Exif & Orientation for DNG's #546

Closed Cotywio closed 1 year ago

Cotywio commented 2 years ago

Describe the bug DNG's from Google Pixel 6 Pro show the incorrect dimensions, orient incorrectly.

To Reproduce Steps to reproduce the behavior:

  1. Upload DNG from Pixel 6 Pro
  2. Click thumbnail to open up picture
  3. Picture rotates to the left
  4. Details show 512 x 680
Screenshots JPG DNG

System

Additional context When viewing the images from the Android app they are flipped, however when viewing from a browser or via the iOS app they are shown in the correct orientation.

I've included the JPG/DNG and docker-compose/.env in the zip below: PXL_20220411_005152876.zip

panoti commented 2 years ago

Hi @Cotywio, correct picture rotation is an immich feature.

alextran1502 commented 2 years ago

Not sure what is wrong with the .dng file but here is what I see when open the file in image viewer on PopOS! (Ubuntu derivative)

image

So the file resolution is correctly extracted from the App standpoint.

We fixed the issue with the orientation in #547

Cotywio commented 2 years ago

Hey @alextran1502, awesome! Glad to hear about the orientation. And agreed its very strange. When I open it in Windows I get the same, but using exif tool 12.44 I get a different result. (as well as in Google Photos and iOS Photos)

WindowsDNG

panoti commented 2 years ago

After small insight, I found that the problem come from our libraries exifr and sharp. I have also tried on 2 other libs (exiftool and exiv2) and both gave good results. I think this issue may be fixed with https://github.com/immich-app/immich/issues/232 once we have selected the appropriate library for reading and writing exif data.

samip5 commented 1 year ago

Please check again if the issue still persists as we have moved to exiftool. @Cotywio

Cotywio commented 1 year ago

Fixed! Thank you for your great work!