Skip to content

Metadata: Unknown values should be ignored when parsing timestamps #2510

Description

@carlonluca

1. What is not working as documented?

PhotoPrism seems to read multiple creation date tags, but the logic seems to return the wrong result.

2. How can we reproduce it?

I created an image with these date tags:

Date/Time Original              : 0000:00:00 00:00:00
Create Date                     : 2007:02:19 00:00:00

and started the scan.

3. What behavior do you expect?

I'd expect the photo to be detected and the valid date to be extracted. Date/Time Original time is clearly empty/invalid, but CreateDate is valid.

4. What could be the cause of your problem?

My understanding of the code is that the DateTimeOriginal tag is extracted and parsed first, then DateTimeDigitized and again CreateDate. In https://github.com/photoprism/photoprism/blob/develop/internal/meta/exif.go#L269 it seems the case of null dates are properly handled but in https://github.com/photoprism/photoprism/blob/develop/pkg/txt/datetime.go#L135 it seems year 0 is remapped to current year. Remapping to current year results in a non-null date, which is therefore immediately considered valid.

I proposed a patch here: #2508.

Metadata

Metadata

Assignees

Labels

metadataRelated to Exif, XMP, IPTC & Co.releasedAvailable in a stable release

Type

No type

Projects

Status
Release 🌈

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions