Lightroom: Problems creating Smart Collection filtered by months and capture date

  • 4
  • Problem
  • Updated 2 years ago
  • Solved
  • (Edited)
Filtering a smart collection by "Capture Date" and Months sometimes doesn't work. I have a smart collection filtering by "captured in the last 5 months but not in the last 4 months" and I get almost all of the pictures in my catalogue in the collection.

I'm using LR3.4.1
Photo of Erez Birenzwig

Erez Birenzwig

  • 3 Posts
  • 0 Reply Likes

Posted 8 years ago

  • 4
Photo of Jim Wilde

Jim Wilde

  • 136 Posts
  • 26 Reply Likes
Somewhat bizarrely, the problem seems to be with the '5 months' element of the smart collection. If I create a simple smart collection with "Capture date is in the last n months", it works perfectly correctly for all values of n apart from 5! When n=5 the result is the same total as 'All Photographs'.

Win7 64bit, LR 3.4.1
Photo of LRuserXY

LRuserXY

  • 426 Posts
  • 41 Reply Likes
Seems to happen for 1, 3, 5, 8, 10, 13, 15, 17... Months. This is funny. By the way: The "is NOT in the last X months" has the same bug, but only negated, i.e. it will show no photos at all for these special values.

P.S. Bug seems to affect the rules for the modify date, too.
P.S. II. I use LR 3.4.1 WinXP SP3 32Bit.
P.S. III: Just a little detail: "Capture date is in the last X months" does not show photos that have no capture date in the metadata. The special values are no exception to this rule. So it seems to be an effect that sets the date to compare to somewhere very far into the past.
Photo of Erez Birenzwig

Erez Birenzwig

  • 3 Posts
  • 0 Reply Likes
Thanks for the confirmation, I thought I was going crazy :)

I'm using weeks in the mean time, but it's not the same...
Photo of John R. Ellis

John R. Ellis, Champion

  • 4567 Posts
  • 1223 Reply Likes
On my system, the problem happens with 5, 17, 29, 41, and 53 months (the current date is 7/30/2011). But if I set my computer's clock to be 7/31/2011, then it happens with 1, 3, 5, and 8 months.

I believe the bug arises from the way LR is computing the beginning date. It takes today's date in year, month, and day format and simply subtracts the number of months, forming the beginning date, without checking that the date is valid. For example, today's date is 7/30/2011; given "in the last 5 months", it constructs the beginning date as 2/30/2011, which isn't valid. It tries to convert that invalid date to internal form, and the conversion routine returns -1 as an error value. LR doesn't check for the error value, and -1 gets interpreted as the earliest possible date.

The correct method would be to set the day portion of the beginning date to the minimum of the day and the maximum number of days in the month.

Working with dates and calendars is much harder than it seems, and programmers often get it wrong.
Photo of Erez Birenzwig

Erez Birenzwig

  • 3 Posts
  • 0 Reply Likes
So basically this problem occurs 1-3 days a month... Funny I never noticed it before.

It'll be fixed by itself tomorrow.

Thanks!
Photo of LRuserXY

LRuserXY

  • 426 Posts
  • 41 Reply Likes
Ok, this makes sense. I testet at the 31th and got 1, 3, 5, 8, etc. When I set the PCs clock to tomorrow, the problems are gone.
Photo of Geoff Walker

Geoff Walker, Champion

  • 223 Posts
  • 47 Reply Likes
What an unusual bug!! Good catch........
Photo of Beat Gossweiler

Beat Gossweiler

  • 238 Posts
  • 39 Reply Likes
This is a known and accepted bug and has been there since LR2.7 (or even before, which I cannot test).

Beat
Photo of LRuserXY

LRuserXY

  • 426 Posts
  • 41 Reply Likes
Yes, the bug seems to date back at least to 2.3 (http://forums.adobe.com/thread/441298 ), but curiously it seems to have had the opposite effect in 2.x, e.g. "last 3 month" showed no photos at all on the critical dates. So the bug persisted, and only the error handling for the invalid date seems to have changed in 3.x.

Ok, doesn't really matter, more important is to know that currently one should avoid the unit "months" (and "hours", see http://feedback.photoshop.com/photosh... ).
Photo of Benjamin Warde

Benjamin Warde, Employee

  • 486 Posts
  • 77 Reply Likes
Hi Erez,

Scratch my previous comment (now deleted). I am able to confirm that the bug occurs (on Windows only) and have also confirmed that it has been previously entered in our bug database.

Thanks,
Ben
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15586 Posts
  • 2345 Reply Likes
Official Response
This issue is solved in Lightroom 4 and later.