Author Topic: Find images with two people identified in them  (Read 1830 times)

Tomhughes

  • Newbie
  • *
  • Posts: 3
Find images with two people identified in them
« on: December 15, 2016, 06:03:26 PM »
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

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3684
Re: Find images with two people identified in them
« Reply #1 on: December 15, 2016, 06:53:08 PM »
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 .
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Tomhughes

  • Newbie
  • *
  • Posts: 3
Re: Find images with two people identified in them
« Reply #2 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.

Hayo Baan

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 1140
  • Professional Photographer & Software Developer
    • Hayo Baan – Photography
Re: Find images with two people identified in them
« Reply #3 on: December 16, 2016, 02:04:50 AM »
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

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3684
Re: Find images with two people identified in them
« Reply #4 on: December 16, 2016, 06:51:13 PM »
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.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Tomhughes

  • Newbie
  • *
  • Posts: 3
Re: Find images with two people identified in them
« Reply #5 on: December 18, 2016, 02:29:44 PM »
Thank you -- that second resource is that much clearer!