Skip to content
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: Incorrect Handling of UTC Time Zone #1668

Closed
dror3go opened this issue Oct 25, 2021 · 16 comments
Closed

Metadata: Incorrect Handling of UTC Time Zone #1668

dror3go opened this issue Oct 25, 2021 · 16 comments
Assignees
Labels
bug Something isn't working released Available in the stable release

Comments

@dror3go
Copy link

dror3go commented Oct 25, 2021

Using 211010 release, I've noticed wrong time shown for some older photos I have.

For example, the following is info about a photo taken at 2015-05-17 23:02:46:

exiftool -n -j 20150517_230246.jpg | grep Create
  "CreateDate": "2015:05:17 23:02:46",

PhotoPrism shows as if the photo was taken at 2015-05-18 02:02:46, with UTC time shown as 2015-05-17 23:02:46.

An example of a newer photo with correct time in PhotoPrism 2021-08-01 09:38:43:

exiftool -n -j IMG_20210801_093842.jpg | grep Create
  "CreateDate": "2021:08:01 09:38:43",

I'm not sure what other information might be relevant here.
If needed, I can send you private links to the photos.

@lastzero
Copy link
Member

Is the time zone UTC or is the UTC time wrong? Could be an estimate based on photos taken at a similar time. You can turn this off in Settings.

@dror3go
Copy link
Author

dror3go commented Oct 25, 2021

Both UTC & local time are wrong in the UI. The timezone itself is correct.
The correct local timestamp of this specific example should be 2015-05-17 23:02:46 and the correct UTC time should be 2015-05-17 20:02:46.
I have no photos taken around 2:00 AM that day, so I don't think that this is the case. What is the time window for estimating time using other photos around that time? FYI it seems that all the photos from around that time are with wrong local & UTC time.

I do have a video taken with the same device (Samsung Galaxy S3) a couple of hours before the photos: the video is shown with correct date & time - I guess thanks on the fix in #1388.

@lastzero
Copy link
Member

About +/- a day. Does the image have a location (GPS)? If not and it has now a time zone out of nowhere, it's an estimate.

@lastzero
Copy link
Member

AVC, MP4 & MOV videos are in UTC by default as that's what the standard says.

@dror3go
Copy link
Author

dror3go commented Oct 25, 2021

The image has a location which I manually set in PhotoPrism, so the Country, Latitude & Longitude are all marked with a V in the photo editing section.

@lastzero lastzero changed the title Local time wrongly shown under time UTC Metadata: Local time is displayed incorrectly as UTC Oct 27, 2021
@lastzero lastzero self-assigned this Oct 27, 2021
@lastzero lastzero added the needs-analysis Requires further investigation label Oct 27, 2021
@lastzero
Copy link
Member

@graciousgrey Is the information provided enough for you to reproduce / test this?

@graciousgrey
Copy link
Member

@dror3go It would be great if you could send us an example photo with the correct time and the one that is not working. We will delete them after testing :)

@dror3go
Copy link
Author

dror3go commented Oct 27, 2021

@graciousgrey I've sent an email to you guys 🙏

@graciousgrey
Copy link
Member

Thank you! I will have a look today :)

@graciousgrey
Copy link
Member

Ok this is probably a bug on our side.

There is a video without GPS information with
"CreateDate": "2015:05:17 17:48:22"
and jpg without GPS information with
"DateTimeOriginal": "2015:05:17 23:02:46", "CreateDate": "2015:05:17 23:02:46",

The current behaviour is the following:

After initial indexing we see:

  • video --> Local Time: 17:48, UTC Time: 17:48, Time Zone: UTC
  • jpg --> Local Time: 23:02, UTC Time: 23:02, Time Zone: Local Time

After I manually set coordinates :

  • video --> Local Time: 17:48, UTC Time: 14:48, Time Zone: Asia/Jerusalem --> This is needs to be optimized
  • jpg --> Local Time: 23:02, UTC Time: 20:02, Time Zone: Asia/Jerusalem --> This is correct

After optimization (in the background or complete re-index):

  • video --> Local Time: 20:48, UTC Time: 17:48, Time Zone: Asia/Jerusalem --> This is correct
  • jpg --> Local Time: 02:02, UTC Time: 23:02, Time Zone: Asia/Jerusalem --> This is wrong

@graciousgrey graciousgrey added bug Something isn't working and removed needs-analysis Requires further investigation labels Oct 28, 2021
@graciousgrey
Copy link
Member

When only setting the country and not the coordinates:

After initial indexing we see:

  • video --> Local Time: 17:48, UTC Time: 17:48, Time Zone: UTC
  • jpg --> Local Time: 23:02, UTC Time: 23:02, Time Zone: Local Time

After I manually set the country :

  • video --> Local Time: 17:48, UTC Time: 17:48, Time Zone: UTC --> This is needs to be optimized
  • jpg --> Local Time: 23:02, UTC Time: 23:02, Time Zone: Local Time --> This needs to be optimized

After optimization:

  • video --> Local Time: 20:48, UTC Time: 17:48, Time Zone: Asia/Jerusalem --> This is correct
  • jpg --> Local Time: 23:02, UTC Time: 20:02, Time Zone: Asia/Jerusalem --> This correct

@graciousgrey
Copy link
Member

When setting country + coordinates manually:

After initial indexing we see:

  • video --> Local Time: 17:48, UTC Time: 17:48, Time Zone: UTC
  • jpg --> Local Time: 23:02, UTC Time: 23:02, Time Zone: Local Time

After I manually set country + coordinates :

  • video --> Local Time: 17:48, UTC Time: 14:48, Time Zone: Asia/Jerusalem --> This is needs to be optimized
  • jpg --> Local Time: 23:02, UTC Time: 20:02, Time Zone: Asia/Jerusalem --> This is correct

After optimization:

  • video --> Local Time: 17:48, UTC Time: 14:48, Time Zone: Asia/Jerusalem --> This is wrong
  • jpg --> Local Time: 23:02, UTC Time: 20:02, Time Zone: Asia/Jerusalem --> This correct

@graciousgrey graciousgrey changed the title Metadata: Local time is displayed incorrectly as UTC Metadata: Local time is displayed incorrectly as UTC after manually setting coordinates Nov 3, 2021
@Fylax
Copy link
Contributor

Fylax commented Nov 5, 2021

Since I found the same problem in my system, I did some extra researches.
Here what I did:

  1. Extracted data with exiftool
$ exiftool -time:all -g1 -a -s DSC_4046.JPG 

---- ExifIFD ----
DateTimeOriginal                : 2021:11:05 16:07:59
CreateDate                      : 2021:11:05 16:07:59
---- Nikon ----
TimeZone                        : +01:00
DaylightSavings                 : No
  1. Added photo to originals folder and started index via WebUI
2021-11-05 16:50:10 INFO media: DSC_4046.JPG was taken at 2021-11-05 16:07:59 +0000 UTC (meta)
2021-11-05 16:50:02 INFO metadata: failed parsing GPS coordinates in DSC_4046.JPG (exif)
  1. Both Local Time and Time UTC are 16:07:59 as expected
  2. After setting GPS coordinates via WebUI (Time Zone and Country detected accordingly) UTC Time is updated correctly
  3. I run, through cli, photoprism optimize, purge and cleanup. Times were still correct.
  4. After some time doing nothing, some background process changed the dates, resulting in:
    • Local Time: 17:07:59
    • Time UTC: 16:07:59

@Fylax
Copy link
Contributor

Fylax commented Nov 6, 2021

Extra info: I had some pictures that I didn't manually geotag yet. Still, they presented the same problem.
Might it be related to face recognition task?

@lastzero lastzero added the in-progress Somebody is working on this label Nov 9, 2021
@lastzero lastzero removed the in-progress Somebody is working on this label Nov 21, 2021
@lastzero
Copy link
Member

Estimates should now be effectively prevented if the location was manually changed, even if it was just the country.
Can't reproduce it with these changes. Please test again! 👍

@lastzero lastzero changed the title Metadata: Local time is displayed incorrectly as UTC after manually setting coordinates Metadata: Incorrect Handling of UTC Time Zone Nov 24, 2021
@graciousgrey graciousgrey added released Available in the stable release and removed please-test Ready for acceptance test labels Nov 29, 2021
@dror3go
Copy link
Author

dror3go commented Nov 30, 2021

Thanks so much for fixing this! I didn't get the chance to deploy a preview build and make some tests myself. Guess I'llsI'll see the results once I'll update my production build.
Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Available in the stable release
Projects
Status: Release 🌈
Development

No branches or pull requests

4 participants