Skip to main content
johnrellis
Legend
Apr 29, 2017 5:23 AM UTC
Released

P: Incorrectly sorts capture time fractional seconds

When sorting Library grid view by capture time, LR doesn't sort correctly by fractional seconds -- it ignores leading zeros in the EXIF:SubSecTimeOriginal field.  To reproduce:

1. Take three photos directly from a camera: a.jpg, b.jpg, c.jpg.

2. Set the DateTimeOriginal and SubSecTimeOriginal field of the three photos using these commands:

$ exiftool -datetimeoriginal="2017:01:02 03:04:05" -subsectimeoriginal=0.1 a.jpg
$ exiftool -datetimeoriginal="2017:01:02 03:04:05" -subsectimeoriginal=0.01 b.jpg
$ exiftool -datetimeoriginal="2017:01:02 03:04:05" -subsectimeoriginal=0.002 c.jpg

3. Import the photos into LR.

4. In the Metadata IPTC panel, observe that Date Created shows what was set in step 2:

a.jpg: 2017-01-02T03:04:05.1
b.jpg: 2017-01-02T03:04:05.01
c.jpg: 2017-01-02T03:04:05.002

5. In Library grid view, do View > Sort > Capture Time.

6. Observe that the sort order is incorrect: a.jpg, b.jpg, c.jpg.   It should be: c.jpg, b.jpg, a.jpg. 

Most likely the Lua code is doing tonumber(subSecTimeOriginal), whereas it should do tonumber(subSecTimeOriginal) / 10^#subSecTimeOriginal.

Tested in LR CC 2015.10 / OS X 10.11.3.

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

johnrellis
Legend
Jul 7, 2019 6:53 PM UTC
I just retested this, and the bug now appears fixed.  So some version between 2015.11 and 8.3.1 fixed it.
Translate
johnrellis
Legend
Apr 29, 2017 4:39 PM UTC
That's probably a separate issue.  It's hard to believe, but some manufacturers still don't record fractional seconds using the industry-standard EXIF field (including Sony, Olympus, and Pentax).   

You can verify if your camera is recording fractional seconds by looking at the field Date Created in the IPTC tagset of the Metadata panel in Library. 

Lightroom could handle this much better by sorting by filename when the capture times are equal: https://feedback.photoshop.com/photoshop_family/topics/sort-by-capture-time-shows-files-in-wrong-ord... .  It's a trivial feature to implement.

The bug reported here normally won't affect bursts of cameras that do record fractional seconds, since they probably all record the same number of fractional digits (e.g. ".009", ".010", ".011").
Translate
Stephen Shankland
Known Participant
Apr 29, 2017 4:30 PM UTC
This would explain why a recent series of burst shots (approx 7fps) show out of order even when sorted by time for me. (latest CC version of LR on Mac OS)
Translate
abhishek_india
Participating Frequently
Apr 29, 2017 11:17 AM UTC
Thanks for updating. Will look into it.

Regards,
Abhishek
Translate