search for images with a given xmp metatag

Started by duns, May 29, 2021, 09:41:50 AM

Previous topic - Next topic

duns

What is the correct syntax to search, from terminal, all the images in a folder that have a given metatag (for example the word "Giotto" in "caption" xmp metag)?
I'm not asking for show all the metatags of one image, ma to show all the names of images with a certain metag.
Thank you!

StarGeek

#1
Exiftool doesn't have the ability to display only tags with a certain value.

You can use the -if option to check specific tags or groups of tags to see if they have a value and list specific tags or groups of tags by group name or with a wildcard.  But all tags listed will be displayed.

If you want to pull only certain tags will certain values, you will need to parse the output with a script or something similar.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Quote from: duns on May 29, 2021, 09:41:50 AM
What is the correct syntax to search, from terminal, all the images in a folder that have a given metatag (for example the word "Giotto" in "caption" xmp metag)?

exiftool -if "$xmp:caption =~ /Giotto/" ... DIR

The ... is where you put whatever you want to do (eg. -filename to show the names of matching files).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

I believe I might have misread this then.  I thought the question was to show all tags that contain a search term without specifying the tags to search.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype