Find images with two people identified in them

Started by Tomhughes, December 15, 2016, 06:03:26 PM

Previous topic - Next topic

Tomhughes

Exiftool lets me easily locate images with a person identified:

exiftool -if '$regionname eq "Thomas Hughes"'  -filename -ext jpg -r .

How do I find files with two people (logical AND) in them? I tried this:

exiftool -if '$regionname eq "Thomas Hughes" and $regionname eq "Catherine Hughes"'  -filename -ext jpg -r .

But that didn't return any results. I'm using Mac OS X 10.11 and exiftool 10.36.

Many thanks!

StarGeek

Your first command will find images that only have Thomas Hughes in them.  It won't find images with Thomas Hughes and someone else.  To do that, you would have to use
exiftool -if '$regionname=~/Thomas Hughes/i' -filename -ext jpg -r .

To find more than one person, try this
exiftool -if '$regionname=~/Thomas Hughes/i and $regionname=~/Catherine Hughes/i' -filename -ext jpg -r .
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Tomhughes

Wow, thank you. This does exactly what I want. Is there a reference you can point to that explains the syntax in the -if statements? I don't quite understand the role of the tildes and the slashes.

Hayo Baan

Quote from: Tomhughes on December 15, 2016, 07:41:41 PM
Wow, thank you. This does exactly what I want. Is there a reference you can point to that explains the syntax in the -if statements? I don't quite understand the role of the tildes and the slashes.
That is the normal perl regular expression syntax.
Hayo Baan – Photography
Web: www.hayobaan.nl

StarGeek

Here's another resource that might be a bit less technically and easier to learn from.  I always find perldoc.perl.org pages to be harder to learn new things from.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Tomhughes

Thank you -- that second resource is that much clearer!