mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
Metadata: Timestamps may be incorrect if non-standard XMP sidecar files are created and uploaded with PhotoSync #1956
Labels
No labels
ai
android
api
auth
awesome
bug
bug
ci
cli
config
database
declined
deprecated
docker
docs 📚
documents
duplicate
easy
enhancement
enhancement
enhancement
epic
faces
feedback wanted
frontend
hacktoberfest
help wanted
idea
in-progress
incomplete
index
invalid
ios
labels
live
live
low-priority
macos
member-feature
metadata
mobile
nas
needs-analysis
no-coding-required
no-coding-required
observability
performance
places
please-test
plus-feature
priority
pro-feature
question
raspberry-pi
raw
released
released
released
research
resolved
security
sharing
tested
tests
third-party-issue
thumbnails
upgrade
upstream-issue
ux
vector
video
waiting
won't fix
won't fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/photoprism#1956
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @charlieshen7 on GitHub (Nov 19, 2023).
1. What is not working as documented?
i use photosync(ios) to upload my photos ans xmp sidecars, but some photos have wrong time
such as this photo was taken at 2023-10-29 22:49:51, but in photoprism, the time is 2023-10-30 06:49:51
I checked yaml in sidecar, the time is correct
and also exif info, time is crrect also
if i choose not send xmp sidecar in photosync, the time will be shown correct in photoprism. but some photos which were download in apps will lose time info, so i have to choose upload xmp sidecar
i check xmp file, it seems nothing wrong. so i don't think it's photosync(ios)'s bug
2. How can we reproduce it?
Steps to reproduce the behavior:
upload wrong time photo with xmp sidecar to photoprism
wrong time photo with xmp file.zip
check the time of the photo
also here is another photo with xmp sidecar, but it can show right time
correct time photo with xmp file.zip
3. What behavior do you expect?
the time of photo can be recognized correctly
4. What could be the cause of your problem?
i cheked the sidecar yaml and exif info of the photo in photoprism, seems nothing wrong
maybe the xmp file caused time offset twice?
in ymal the takenat is 2023-10-29T14:49:51, takenatlocal is 2023-10-29T22:49:51
but if calucale +8 again with takenatlocal, the time becomes the wrong time 2023-10-30 06:49:51
5. Can you provide us with example files for testing, error logs, or screenshots?
6. Which software versions do you use?
(a) PhotoPrism Architecture & Build Number: AMD64, 231021-9abea5b55
(b) Database Type & Version: MariaDB 10.11
(c) Operating System Types & Versions: Linux
(d) Browser Types & Versions: Firefox, Chrome
(e) Ad Blockers, Browser Plugins, and/or Firewall Software? NO
@lastzero commented on GitHub (Nov 19, 2023):
Sorry, just a quick reply since it's Sunday night. I suspect that part of the problem might be the added offset and the fact that
DateCreatedis normally in UTC when the field itself does not specify a different timezone:Combined with this feature request we recently implemented, it could lead to the observed behavior:
Please also clarify whether you are referring to an XMP sidecar file or embedded XMP information. If you are using both, please explain the use case for our understanding. This could clearly make things more complex as you then have multiple timestamps in different sources such as Exif, embedded XMP and an XMP sidecar file.
@lastzero commented on GitHub (Nov 19, 2023):
It would be great if you could also attach a screenshot of the PhotoSync settings. Note that it can also submit some information to PhotoPrism via HTTP header (in addition to the embedded metadata).
@charlieshen7 commented on GitHub (Nov 19, 2023):
I mean XMP sidecar file, i think some photo has embedded XMP information, you can use the zip file i uploaded when you have free time
here are my photosync settins (about xmp sidecar settings)
I choosed always in "Transfer XMP Sidecar File" beacuse some photos download in other app like wechat, need xmp sidecar file to recognize the correct time
@lastzero commented on GitHub (Nov 19, 2023):
Does it work when you disable the XMP sidecar file? From all I know, it's not needed for transferring photos to our software and only makes indexing more complicated and slower (plus it can lead to weird behevior as we don't test with these non-standard PhotoSync settings).
@lastzero commented on GitHub (Nov 19, 2023):
Based on our documentation, there is initial support for "DateCreated" in XMP, but not for "OffsetTime" if it's a separate field (so if you have the timezone/offset from some metadata source in combination with an XMP timestamp that doesn't have a timezone, I would suspect side effects similar to those you've observed):
@lastzero commented on GitHub (Nov 19, 2023):
Looking at the XMP file, it looks as if
2023-10-29T22:49:51is interpreted as UTC time and then 8 ours are added which gets us to2023-10-30 06:49:51local time.Note that the XMP specification requires a timezone to be specified with a timestamp, however, it is missing in the sample file you provided:
Compare this with what's found in the XMP file:
@lastzero commented on GitHub (Nov 19, 2023):
Based on this, a solution could be to ignore such incorrect XMP timestamps completely. However, some users might also report this as a bug because they want it to be used, e.g. if no other information can be extracted directly from a media file.
@charlieshen7 commented on GitHub (Nov 19, 2023):
If I disable this setting, the wrong timestamp photo will become have a correct time
However some other photo's timestamp will go wrong 😢 (as what you say, some photo without information need this xmp timestamp)
such as this photo with xmp sidecar file: correct time photo with xmp file.zip
this photo seems has no embeded xpm infomation, so it needs xpm file for the correct time, and in this xmp sidecar file, it has not timeoffset info, which make timestamp shown correctly
are there any solution to make these two kinds photo with xmp sidecar file have correct timestamp both? (such as i can choose whether i need to adjust the time zone when importing, it will lose correct timezone info, but can show correct time at same time)
my ultimate demand just want the photos upload from my iphone are in the same order as in Apple Photos
@lastzero commented on GitHub (Nov 20, 2023):
I'm wondering what kind of photos created by an iPhone won't already have time information embedded? Note you can additionally choose to transfer photos with the date as filename, which is what I would recommend anyway instead of the original name like IMG_1234.JPG which isn't of any use to other applications and/or humans looking at it.
@charlieshen7 commented on GitHub (Nov 20, 2023):
will file name change photo's timestamp in photoprism?
@lastzero commented on GitHub (Nov 20, 2023):
The filename can be used by PhotoPrism as a fallback if no other time information is available. Note, however, that I have not actively tested this particular functionality with that filename pattern yet. If changes are required, they can be quickly implemented from our side. Of course, time zone information or GPS coordinates cannot be extracted from filenames, so it's really just a fallback mechanism, e.g. for messengers like WhatsApp that don't add metadata to received images.
@charlieshen7 commented on GitHub (Nov 21, 2023):
I suspect that the information was lost when uploading the file.
I tried the other photo backup software such as immich, and most of the photos can recognize the timestamp normally.
Later I will try to use syncthing to synchronize photos directly (this can completely retain the file information and see if the timestamp of the photo can be displayed normally)
@graciousgrey commented on GitHub (Nov 21, 2023):
A new version of PhotoSync was recently released. The changelog includes "support for iOS 17".
https://www.photosync-app.com/support/release-notes/photosync-4-8-for-ios-released
Have you tested with this new version?
@graciousgrey commented on GitHub (Nov 21, 2023):
I took a closer look at your files. As lastzero said, both have an XMP date without specifying the time zone.
PhotoPrism now assumes that the specified time is UTC.
The difference between your two images is that one contains GPS coordinates. PhotoPrism uses the coordinates to set a time zone and then calculates the local time from the time specified in the xmp file.
This results in photos with coordinates having "incorrect" times and photos without coordinates appearing to have "correct" times. If you would add coordinates (e.g. in the PhotoPrism user interface) to the files that now appear to have the correct date, the local time would also be updated.
To solve this problem, PhotoSync would need to add the time zone information to the xmp files.
Have you tried using PhotoSync with xmp files disabled and the "Embed adjusted date" option enabled? Do you know where the files without date come from? Is it a file that someone sent you via Messenger? How did you add the missing dates so that PhotoSync could add them to the xmp file?
@Ghu-svg commented on GitHub (Sep 8, 2024):
@Ghu-svg commented on GitHub (Sep 8, 2024):
What does this offset time mean my time zone is central photo was taken at 6:30 pm offset -0500