-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metadata: Default to landscape orientation if data is invalid #1052
Comments
Do the exif metadata contain wrong values? |
You can use the reader tool of go-exif to find all rotation tags. Old files sometimes contain conflicting duplicates. |
I'm unsure. All the image viewers I have tried it on open the files just fine, even photoprism's thumbnail generator gets it right. Just the image viewer gets it wonky. Wondered if that would be a clue to the solution. |
That's interesting, photoprism's files viewer reports it as portrait, but it's definitely landscape.
|
We use different libraries for this, that's why I said conflicting duplicates :) |
So, is there anything more I can do to help with this? |
What is the orientation of this image? |
So that info is for the image I embedded in the original post. It's landscape, but PP thinks it is portrait, hence the distortion as it forces it into that shape. |
I'll try to get the data you want to too you soon, my toddler just threw my laptop on the ground 🤦♀️ Think I'd better give him some attention. |
Exiftool and exif-read-tool show that the files metadata contains an invalid value for orientation. So PhotoPrism can't know its real orientation and uses portrait as fallback |
Thanks, you just beat me to posting the same thing ha ha. However, I notice that it reports width and height correctly, perhaps instead of having a default of |
So, I'm not used to go (mostly php and js for me), but it looks like you check case of orientation first, then if that is 0, check for rotation. Perhaps you could add a check that if it is still 0 then calculate from width & height? photoprism/internal/meta/json_exiftool.go Line 162 in b433c63
|
We extract width and height directly from the image but there is another exif reader for thumb generation that may be confused by the header... orientation is something like 834534... values between 1 to 8 are valid. You see the issue? |
Indeed. Stupid microsoft camera app on the HD2. But given it's popularity back in the day, there will be lots of photos out there with invalid orientation data, would it be worth adding a check for this case as mentioned above? |
$ exiftool -j metaOrientation.jpg
$ exif-read-tool -f metaOrientation.jpg
|
We should default to landscape if possible. |
Started a new build for this: https://docs.photoprism.app/getting-started/updates/#development-preview |
I can confirm this has fixed my issue. Thank you very very much ✔😊 I was about to say it hadn't, then I realized I needed to reindex. I started it and thought "this is going to take forever! I wish there was a way to only reindex one folder..." Then remembered there was 🤦♀️, so I did that. I love PP, you've designed the backend so well! |
Hi. Once again, thanks for your hard work on this project, I really do appreciate it.
I spotted a small bug. Photos form a certain old camera phone (HTC HD2 if memory serves) sometimes display extremely distorted when in the viewer, but the thumbnails render fine. I believe that the photo viewer is passing the aspect ratio in reverse in these cases. For instance instead of 1 16:9 image being displayed as 16:9, it is displayed as 9:16. I've attached a screenshot and the original file in case it's meta data help track down the bug.
Thanks for your time.
Thumbnail from gallery:

Photo Viewer:

Original file:

The text was updated successfully, but these errors were encountered: