The ExifTool Command Processor

The ExifTool Command Processor allows you to directly access ExifTool without leaving IMatch.

A Word of Caution:
ExifTool is very powerful and can add, edit, update and delete metadata and files.
IMatch cannot control what you are doing when you are directly working with ExifTool, so please read the ExifTool documentation (see below) and only work on images you have backups for.

What Does It Do?

IMatch contains many easy to use and flexible tools to add, edit and maintain metadata in your files. But sometimes you may want to use the powerful ExifTool application directly, e.g., to access special functions not available in IMatch.

The ExifTool Command Processor (ECP) presents a graphic user interface for the exiftool.exe command line application. ExifTool messages are shown in a dedicated panel. Frequently used commands can be saved and recalled for re-use. One of the major benefits of the ECP is that you have full access to IMatch Variables and you can use them in many ways to feed and control ExifTool.

Basic Operation

To start the ExifTool command processor go to Tools > Exif Tool Command Processor or press the associated keyboard shortcut.

The ECP dialog box opens. It consists of two main panels. The panel on the left contains the arguments (command line) you want to run and the panel on the right shows output and messages emitted by the ExifTool command line application.

The drop-down list at the top contains all presets you have saved. This allows you to set up frequently used commands and recall them later from this list.

To run a command, type the command line parameters into the box Arguments on the left and press the Run key (or press Alt+R). The ECP then runs exiftool.exe in the background using the supplied arguments and redirects the ExifTool result into the Output panel on the right.

You can use Copy and Paste to transfer the ExifTool result from the Output panel to the Windows clipboard.

The ECP uses ARGFILE file syntax (see the ExifTool command line documentation for details). Each command must be in a separate line. For arguments which require additional options, these options must be in a separate line. Every command allowed in a normal ARGFILE is also allowed in the ExifTool Command Processor.

Working with Presets

Presets allow you to store frequently used commands and to recall them at a later time.

When you press the Save button, the ECP saves the current contents of the Arguments edit field under the name currently visible in the Presets drop-down list. To save the current arguments under a specific name, enter the name in the list and then press Save.

To delete the current preset, click the Delete button.

Run Modes

The ECP supports two run modes. This is because of how the ECP works with the current selection in the current file window. If more than one file is selected you can either run exiftool.exe once for all files or once for each individual file in the selection. Whether you need to run your command once or multiple times depends on the command and how you use IMatch variables in your arguments.

By default, IMatch runs the command you have specified once, and hands over the names of all selected files to ExifTool. The resulting arguments file is processed once by ExifTool, and ExifTool applies whatever command you have specified.

Depending on the commands you want to run, processing multiple files at once may not be possible. In this case you need to switch to Run for each file in selection. In this mode, IMatch runs ExifTool once for each selected file, handing over the arguments you have specified. This may be required for some commands to work. ExifTool cannot execute all commands on multiple files.

If you use the Run Once mode and more than one file is selected, Variables cannot be used.
If you want to use variables, switch to Run for each file... mode. IMatch needs to evaluate variables once per file. In this case, use e.g. {File.FullName} to specify the file name to use. Don't use {Files} in this mode.


Protection Against Harmful Presets

If you create a preset which deletes or modifies data, you can add a special comment to it. When the ECP detects this comment in a preset, it displays a warning message.

If the first line contains a comment with the token im-warn:

# im-warn

the ExifTool Command Processor displays a prompt and asks the user for permission to run the arguments. This can prevent data loss when you accidentally run the wrong preset.



Comments

If you want to add comments to your preset, start the line with a #. ExifTool ignores lines starting with #.

# This line is a comment.

Using Variables

The ability to use variables makes the ECP even more flexible than ExifTool alone. Consider the following ExifTool command:

 -all
c:/images/picture.jpg"

When you run this command via the exiftool.exe command line application, ExifTool displays all the metadata contained in the file "c:\images\picture.jpg". You can type this command directly into the ECP and execute it. It will work (assuming that you have a file with that name). But it would be inflexible because it works only with exactly this file.

{Files}

 To make this more flexible you will use a variable:

 -all
{Files}    

This argument sequence also lists all the metadata contained in files. But by using the special variable {Files} it now works with all files the current selection.

When you run this command the ECP replaces {Files} with the fully qualified names of the selected files in the file window. It automatically uses the proper formatting required by ExifTool. Whether one file or 100 files are selected, ExifTool will run the command on these files for you.

{XMPFiles}

This variable works like {Files} but uses the XMP file name instead. This allows you to read or write the XMP files of all selected files. This variable assumes there are XMP files (when you read) so it's up to you whether you use {Files} or {XMPFiles}.

Other Variables

In Addition to the special {Files} variable you can use any IMatch variable you want. The most frequently used variables can be accessed via the Insert button next to the Arguments edit control:

Using these variables allows you to make your arguments more dynamic and sensitive to the current selection.

For ExifTool commands which don't require input files (e.g. -ver) you don't need to use variables.
And you can of course also include hard-coded file names in your arguments if you like.

Using -overwrite_original_in_place

If your preset changes metadata in files, always include -overwrite_original_in_place in your preset. This prevents ExifTool from creating backup files and from working with temporary copies. This may confuse IMatch and the folder monitoring in Windows.

Examples:

This section lists a number of example arguments. Use them for a start and change them as needed. The ExifTool command line documentation has detailed information about the arguments used in these examples.

Example 1: List all metadata in all selected files

-all
{Files}

The resulting output is displayed in the Output panel in the ECP.

 

Example 2: List all metadata in all selected files, with groups and tags in their original locations

-G1
-all:all
{Files}

Example 3: Delete all metadata from all selected files (WARNING)

-overwrite_original_in_place
-all=
{Files}

This command removes all (removable) metadata from all files currently selected in the file window.

Example 4: Set the headline

-overwrite_original_in_place
-xmp-photoshop:headline=This is the new headline
{Files}

Example 5: Adjust EXIF Date and Time Original by - 1:30 hours

-overwrite_original_in_place
-DateTimeOriginal-=0:0:0 1:30:0
{Files}

Example 6: Importing GPS data from GPX files

The following example allows you to import GPS coordinates from a GPX file into the actual image file:

-overwrite_original_in_place
-geotag={File.Path}20160101.gpx
{File.FullName}

Replace 20160101.gpx with the name of the actual GPX file and use this with the Run for each file Run Mode to ensure proper operation.

Updating the Database

IMatch automatically recognizes files changed by your arguments and rescans them to bring the changes into the database. When you create new files from the ECP, these files will be imported when you rescan the folder the next time, or automatically if you have enabled background indexing.

Do not run arguments from the ECP which rename existing files or perform other operations which change the structure of the file system.
Also do not change the "last modified" time stamp in the Windows file system to a later date and time. This may confuse the mechanism in IMatch which detects updated files.