Lightroom: Incorrectly sorts capture time fractional seconds

  • 1
  • Problem
  • Updated 2 years ago
  • In Progress
  • (Edited)
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.
Photo of John R. Ellis

John R. Ellis, Champion

  • 4053 Posts
  • 1067 Reply Likes

Posted 2 years ago

  • 1


  • 37 Posts
  • 17 Reply Likes
Thanks for updating. Will look into it.

Photo of Stephen Shankland

Stephen Shankland

  • 91 Posts
  • 18 Reply Likes
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)
Photo of John R. Ellis

John R. Ellis, Champion

  • 4053 Posts
  • 1067 Reply Likes
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: .  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").