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

Fix sorting by dateTaken and dateModified #1925

Open
paperboyo opened this issue Jun 10, 2016 · 6 comments
Open

Fix sorting by dateTaken and dateModified #1925

paperboyo opened this issue Jun 10, 2016 · 6 comments

Comments

@paperboyo
Copy link
Contributor

paperboyo commented Jun 10, 2016

dateTaken acquiring logic much improved (see last comment). We should fix sorting by dateTaken and dateModified.

Hello,

Grid’s is not able to acquire dateTaken correctly. Here is a bunch of examples converted using latest Lightroom: [PROD]search?query=~"dev blog"&uploadedBy=[me]@guardian.co.uk

All dates are (and, consequently, ordering) are wrongly set at:
"dateTaken": "2016-06-10T00:00:00Z",

We already read correct dateTaken which is recorded in multiple places inside fileMetadata, e.g.:

iptc": {
    "Digital Time Created": "15:28:37",
    "Digital Date Created": "20160610",
    "Time Created": "15:28:37",
    "Date Created": "Fri Jun 10 00:00:00 UTC 2016"  
"exifSub": {
"Date/Time Original": "2016:06:10 15:28:37",
    "Date/Time Digitized": "2016:06:10 15:28:37",

Recent updates to metadata-extractor cite

Considerable overhaul of date, time and time zone handling across the library #153 #154 #155 #158

Maybe if we would to update it, we wouldn’t have to think too hard about how should we reconcile the dates ourselves?

FYI, full exiftool dump reveals:

---- ExifTool ----
ExifTool Version Number         : 10.09
---- File ----

File Modification Date/Time     : 2016:06:10 22:55:19+01:00
File Access Date/Time           : 2016:06:10 22:17:27+01:00
File Creation Date/Time         : 2016:06:10 22:17:27+01:00
---- EXIF ----
Modify Date                     : 2016:06:10 22:17:29
Date/Time Original              : 2016:06:10 15:28:37
Create Date                     : 2016:06:10 15:28:37
---- XMP ----
Modify Date                     : 2016:06:10 22:17:29+01:00
Create Date                     : 2016:06:10 15:28:37
Metadata Date                   : 2016:06:10 22:55:19+01:00
Date Created                    : 2016:06:10 15:28:37
History When                    : 2016:06:10 22:17:29+01:00*2016:06:10 22:54:54+01:00*2016:06:10 22:55:19+01:00
---- IPTC ----
Date Created                    : 2016:06:10
Time Created                    : 15:28:37
Digital Creation Date           : 2016:06:10
Digital Creation Time           : 15:28:37
---- Composite ----
Date/Time Created               : 2016:06:10 15:28:37
Digital Creation Date/Time      : 2016:06:10 15:28:37

Regards
Mateusz

@paperboyo paperboyo changed the title Date taken reconciliation logic widely incorrect Date taken acquiring logic incorrect Jun 13, 2016
@paperboyo
Copy link
Contributor Author

Also, this all-too-common "dateTaken": "2016-06-14T00:00:00Z" shows up in the UI differently depending on client's time zone. In my semi-holiday location (PL), it becomes:

"Taken on 14 Jun 2016, 02:00"

Hmm...

@paperboyo
Copy link
Contributor Author

From my very crude tests, it looks like huge majority of all images (~3/4) haven't got time in dateTaken read correctly. Please compare:

[PROD]/search?dateField=taken&takenSince=2016-06-12T23:59:59.999Z&takenUntil=2016-06-13T00:00:01.000Z (16 289 matches)

[PROD]/search?dateField=taken&takenSince=2016-06-13T00:00:01.000Z&takenUntil=2016-06-13T23:59:59.999Z (4 721 matches)

@paperboyo
Copy link
Contributor Author

Also, even when we read the time of dateTaken correctly, we do not read seconds (which most probably affects thumbnail ordering...). Example: e47473bc39977c75eed3bb1711c52baded013a18 (we read dateTaken: "2016-06-13T15:02:00Z" while Date/Time Original: "2016:06:13 17:02:46" or Date/Time Digitized: "2016:06:13 17:02:46"). Also, the timezone seems wrong (although, I can't get my head around this ever...).

@paperboyo
Copy link
Contributor Author

See drewnoakes/metadata-extractor#158 and drewnoakes/metadata-extractor#344 for a method of getting composite values from multiple tags including sub-second values and time zone. Meta-isuue: drewnoakes/metadata-extractor#147.

@paperboyo
Copy link
Contributor Author

Greatly improved by #2180!

Current reconcilliation can be improved still, MWG recommends some sensible fallbacks. Also see.

We should fix sorting by dateTaken. We should decide what to do with partial dates (no subseconds, no seconds, esp. no hours) – read them and fallback on sort to uploadTime?

@paperboyo paperboyo changed the title Date taken acquiring logic incorrect Fix sirting by dateTaken and dateModified Sep 15, 2018
@paperboyo paperboyo changed the title Fix sirting by dateTaken and dateModified Fix sorting by dateTaken and dateModified Sep 15, 2018
@sihil sihil added the To Review PRs that need to be reviewed label Sep 8, 2020
@paperboyo paperboyo added enhancement and removed To Review PRs that need to be reviewed labels Sep 8, 2020
@paperboyo
Copy link
Contributor Author

Just adding this in case it will ever be useful (thanks, @davidfurey!): https://www.loc.gov/standards/datetime/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants