Add Option 'Is Empty' for Date Fields When Using Filters

I use filters a lot, and would find an 'Is Empty' option for date fields extremely helpful. Currently, one must use 'After', 'At' or 'Before'.

For example, if I use 'Date Taken' in a filter, and want to find photos without a Date Taken, I cannot. I need to enter a date, so I enter a date like: After 1900-01-01

I use many filters to find photos with no date in a date field. My most important filter looks for dates with an EXIF DateTimeOriginal before 1900-01-01.
But that filter has never worked well for me. If Opus doesn't freeze, it it extremely slow, and many of the results generated do include an EXIF DateTimeOriginal AFTER 1900-01-01.
I'm wondering if perhaps the filter would work better if an 'Is Empty' option were available.

You can use a textual filter to search for empty date fields, e.g.

=Val("scp:ExifTool/EXIF-DateTimeOriginal")==""

That said, the option to search for empty or missing fields seems useful.

LXP,
Thank you. Like this?
image

yes

Thank you, but it's not working. Results included folders. I am trying to figure this out.
Do I need to be using an evaluator column?
image

If I do need to use an evaluator column, that will be challenging. I don't know if I'm up to that challenge. I have read all the Evaluator info in the manual, but I still don't even know how to start and figure out what the Keyword should be, since no keywords for Script columns are listed.

Try using:
=Val("scp:ExifTool/EXIF-DateTimeOriginal")=="" and !is_dir

to exclude folders.

There are two types of textual filters: standard and evaluator. They have a similar syntax but cannot be mixed (that's what you tried).

I see three options for you:

:one:
Write the whole filter as eval filter, following @errante's example. Gotta learn a bit of evaluator stuff then, I guess.

:two:
Save the eval filter...

and use it the classic way (probably the easiest)

type match group Images and filter match EmptyDate

:three:
Use the eval filter and an indexed search (with Everything) to remove the unwanted items. A nice option because of Everything's speed. You'll need to know Everything search syntax then.

This should be quicker the other way around, so it doesn't call the ExifTool script column when it knows it isn't of interest:

=!is_dir and Val("scp:ExifTool/EXIF-DateTimeOriginal")==""

Thank you LXP, errante, and Leo. Nothing is working, and my workday is done. I might try more tomorrow.
Please consider adding an 'Is empty' option in filters.

Thank you Leo,
It took 62 minutes to filter about 123,000 files for images with no EDTO, but the results were accurate.


I'm glad Opus did not freeze or crash, but that is slow!

Then I did as LXP suggested and created this filter:


The results included all image files - with and without an EXIF DateTimeOriginal

So, it's an improvement over this:


Because all results were good (did not have an EXIF DateTimeOriginal and Opus did not freeze or crash.

Please consider adding an 'Is empty' option in filters.

The logic Leo explained above also applies here: run the FileTypeGroup clause first so the following script column only has to process images (whose values might already be in the cache).

This edited filter:


is slightly faster, but there are still way too many (thousands too many) false results--photos with an EXIF DateTimeOriginal.

Searching for empty columns seems to be trickier than I thought :sweat:

Please try your search with the following modifications:

A. Modify the column definition in /scripts\ColumnExifTool.js.txt to

exifColumns.push_back(GetColumnMap('EXIF', 'DateTimeOriginal', '', '', '', '9999-12-31', '', 'datetime'));

B. Modify the search filter to

type match group Images
and script match ExifTool/EXIF-DateTimeOriginal on 9999-12-31 00:00:00

This worked much better in my testing. Why? We use the script's optional default value to let Opus search for a real date instead of an empty string.


I ran this search on a folder

  • 18.500 images
  • 33.600 files total
  • 530 GB size total
  • SATA-HDD
  • ExifTool cache on system SSD, completely built

Took Opus a little under three minutes.

LXP,
Thank you. I have not tested that yet, and probable won't today, but yesterday I tried again (for about the 63rd time) in my ongoing quest to effectively find photos with no EXIF DateTimeOriginal.


type match group Images
and script nomatch ExifTool/EXIF-DateTimeOriginal before 2024-02-01 00:00:00

The results were all files with NO EXIF dates at all!!!

So, now I want to re-run some filters I tried before to look at the results more carefully!

LXP,
I did just try it with a small sampling of files, and it seems to work, but the date 9999-12-31 12:00 AM is assigned to files without an EXIF DateTimeOriginal.
I don't like having a date added! Now I'll need to remove that date. I suppose I'll have to create another Exiftool command to remove the date!

Here's an idea for the developers: How about adding as 'Is Empty' option to the filters????

This one line doesn't change the files, not even the cache. It just changes what is displayed in case the field is empty.

If you don't like the column's look in the file display use an additional column like

exifColumns.push_back(GetColumnMap('EXIF', 'DateTimeOriginal', 'DTOplus', 'DTOplus', 'DTOplus', '9999-12-31', '', 'datetime'));

instead of the original one for all your searches.

LXP,
Thank you. Editing the script did produce results faster.

My request for an 'Is Empty' option still stands. I would use 'Is Empty' for several different date fields for both photos and videos.

Leo,
Will you consider adding 'is empty' for all date fields in filters?
Who else things it's a good idea?

It's already on our list, with a lot of other things.

1 Like

Great! Thank you.
When nothing is said about a request (by anyone), I have no idea whether it has been deemed irrelevant and will be ignored, or whether developers believe an idea has merit.
I understand you get many requests, and I know change doesn't happen overnight.