Skip to content

Metadata: Prefer SubSecDateTimeOriginal and SubSecCreateDate timestamps #2320

@danielhoherd

Description

@danielhoherd

What does not work as described in the documentation?

  • Photo detail views have incorrect datetimes in some circumstances
  • Chronological sort is incorrect in some circumstances

When viewing collections of images, timezones are not considered when sorting photos. Photos from two separate cameras set to the same objective time but with a different timezone will not correctly sort chronologically. It appears that the location of the photo may be interfering with correct interpretation of the time.

Photo details views show incorrect TZ and time when the TZ of the camera body does not match the photo geolocation.

How can we reproduce it?

Steps to reproduce the behavior:

  1. Set your DSLR to GMT.
  2. Take a photo.
  3. Geotag this photo into a non-GMT timezone.
  4. Notice the photoprism miscalculates the date as being taken within the geotagged timzeone, not what is shown in an exif tag that contains the TZ.

What behavior do you expect?

I expect photos that include the TZ in their exif data to be shown with correct times and sorted correctly among other files from different TZs.

What could be the cause of your problem?

It looks like there may be multiple things going on. The DB does not appear to store TZ data, although there is a photos.taken_at_local column. This column appears to be the result of some changes that take into account the location of the photo and the photo exif data. For example, the following photo shows 10:01 PM EDT.

Screen Shot 2022-05-13 at 6 26 57 PM

The photo was taken in EST, but clearly it is not 10pm EDT since it's daytime. The details view of that photo does indeed show that it is in America/New_York TZ.

Screen Shot 2022-05-13 at 6 25 00 PM

However, the camera that took that photo was set to GMT (because who wants to mess with TZ's every time you travel?) We can see in the exif data that it was taken at 10:01 GMT (+00:00):

$ exiftool -s -SubSecDateTimeOriginal -SubSecCreateDate -DateTimeOriginal -CreateDate 20220511-22-01-32_455c68.dng
SubSecDateTimeOriginal          : 2022:05:11 22:01:32.74+00:00
SubSecCreateDate                : 2022:05:11 22:01:32.74+00:00
DateTimeOriginal                : 2022:05:11 22:01:32
CreateDate                      : 2022:05:11 22:01:32

So my suspicion is that the import of photo metadata into Photoprism is ignoring fields that have more rich datetime data that includes the TZ. These fields are less ubiquitous than the TZ naive fields, but they are quite common in modern cameras, and if the TZ data is included in the exif then it should certainly be used. This is especially important for people who travel because they often forget to change the TZ on their camera, and end up shooting a bunch of photos with the clock set to the wrong timezone. If TZ data is available in the file and is used, then photoprism can gracefully deal with the photographer's mistake. If TZ data from the file is ignored, then we have chronological sort problems and incorrect metadata showing up in photo detail views.

Can you provide us with example files for testing, error logs, or screenshots?

I can provide sample files if asked to, but I don't think I have anything especially rare that you couldn't create by just using exiftool to change the dates on a file or using a DSLR with its clock set to another TZ.

Which software versions do you use?

  • photoprism/photoprism:latest bc710aa81b1e (Build 220302-0059f429-Linux-AMD64)
  • mariadb:10.6 3a25dc0f1777
  • Ubuntu 22.04

On what kind of device is PhotoPrism installed?

  • Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (as reported by lscpu)
  • 49257296 memory (as reported by free)
  • SanDisk SSD PLUS 1000GB (as reported by lsblk -do NAME,SIZE,MODEL)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreleasedAvailable in the stable release

Type

No type

Projects

Status

Release 🌈

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions