-
Notifications
You must be signed in to change notification settings - Fork 5
Home
Welcome to the cbird wiki! Just random stuff for now
Filters can be used for a few things, but usually it is
- limit scope of the search
- remove or select certain results
Say you know that the originals were taken before a certain date, so you only want to find duplicates of these.
You can use -with
to select the subset, then search within the subset using "@" to refer to it.
cbird -select-type i -with exif#Photo.DateTimeOriginal#todate '<2022-01-03' -similar-to @
You have a project folder that is known to have valid copies of your assets/originals folder, and you don't want to include it. You can use a regular expression to select the search set, then search within it.
cbird -select-all -without relPath ':^projects/.*' -similar-in @
You have a folder "incoming" with new content, if the file size is larger than the existing content, then you want to examine it since it's more likely to be a dupe you want to keep. Note: there is no guarantee that this assumption is correct, but it may suit your needs.
cbird -similar-to ./incoming/ -with fileSize '<=%needle' -show
You can now batch-delete the other ones by inverting the filter:
cbird -similar-to ./incoming/ -without fileSize '<=%needle' -first -select-result -nuke
If you want to combine filters there are two boolean options. These are evaluated left-to right. The -or-*
version (added in v0.7.1) must be preceded by a -with
filter.
-
-with [this] -with [that]
-- with this AND that -
-with [this] -or-with [that]
-- with this OR that -
-with [this] -or-with [that] -with [theother]
-- with (this OR that) AND theother
A property can be followed by hash (#) and a series of transformations/functions
Lowercasing to Test Strings
-with name#lower '~robert paulson'
Date/time conversions
-with exif#Photo.DateTimeOriginal#month '<2020-01'
Boolean tests on properties (v0.7.1)
-
-with name#lower '~milk || ~cookies'
== images of only milk, only cookies, or both -
-with name#lower '~milk && ~cookies'
== images with both milk and cookies
Type conversions for metadata properties to enable correct evaluation (v0.7.1)
-with exif#Photo.DateTimeOriginal#todate '>=2021-01-01 && <2022-02-01'
- date is sometime in January 2021
Comparison with the needle property (v0.7.1)
-similar-to ./originals -with res '==%needle' -with suffix '==%needle' -with fileSize '<%needle'
- assume dupes are of lower quality due to smaller size at the same resolution and file type