Search code examples
imagemetadataexifexiftooliptc

Filter out images which don't have IPTC metadata


I like ot filter out images and move them to another directory that either doesn't have,

  • Title
  • Description
  • Headline
  • Keywords

filled.

If any of the above missing, move to new directory.

I think Exiftool could do this


Solution

  • The basic exiftool command would be:
    exiftool -if "!$Description or !$Headline or !$Subject or !$Title" -Directory=/path/to/moved/ /path/to/source

    This checks each of the tags you list and if any one doesn't, it will be moved to the directory indicated by the Directory tag.

    This command assumes that you are using IPTC Core (aka XMP) tags. If you file only has the older IPTC IIM/Legacy tags, it will not get moved, even though Bridge would display the file as having the data. This is because Bridge will read data from either the IPTC IIM or IPTC Core, whichever tags exists, to fill out the data it displays.

    A more complete command which would check to see if at least one of the IPTC Core/IPTC IIM tags have data would be
    exiftool -if "(!$Description and !$Caption-Abstract) or !$Headline or (!$Subject and !$Keywords) or (!$Title and !$ObjectName)" -Directory=/path/to/moved/ /path/to/source

    If you are running on Mac/Linux change the double quotes into single quotes in order to prevent the shell from interpreting the tag names as shell variables.