FastPhotoTagger
  ExifTool Command Builder









The ExifTool Command Builder provides an interface to the ExifTool command line from within FastPhotoTagger.

ExifTool is designed as a command line utility and implements a rich and powerful command language. FastPhotoTagger implements only a limited graphical user interface (GUI) to ExifTool. To enjoy the full potential of ExifTool a command line is required.

The ExifTool Command Builder provides a simple interface to the ExifTool command line allowing virtually any command line to be built and executed.





Command line operations are potentially destructive to your files. You should not use this capability unless you are comfortable with ExifTool command line processing. Test operations on unimportant files before applying to important files.

The steps for using the FastPhotoTagger ExifTool Command Builder are
o If you have any changes in progress (in "Program Settings / Pending Changes"), write them to disk.
o (optional) Select one or more image files. (If performing an operation on folders you should not select any files.)
o Open the ExifTool Command Builder by invoking it from the overflow menu or typing CTRL-E.
o Choose and edit ExifTool options.
o Review (and edit if necessary) the constructed command line.
o Run ExifTool and review the ExifTool output.
 



Choose and Edit Options




The Command Builder starts up showing some frequently used options and operations. You should check or uncheck these choices as you require. (See the examples below for some other operations you can do.)

The second column of each table is editable. You can change what is there or you can enter your own options and operations in the blank rows. Some operations contain "placeholder" values such as tagsss. These need to be edited for the specific operation at hand. Any text strings entered that contain spaces must be surrounded by quotation marks, "like this".

The strings "filesss" and "foldersss" will trigger file and folder chooser dialogs so that you don't have to type or paste paths into the table.

The strings "tagsss" and "tagddd" will trigger input dialogs so that you don't have to type into the table. In these dialogs, you may type a tag name or select from frequently used tag names in a drop down list.

Be sure to check the boxes on the rows you plan to execute.

For example, suppose you wish to copy values from XMP:XMP-dc:Description into IPTC:Caption-Abstract. You would check the box on the -tagddd<tagsss line of the Tag Operations table, then edit -tagddd<tagsss to become -IPTC:Caption-Abstract<XMP:XMP-dc:Description or just press "Next" to trigger input dialogs. Fully qualified (Group0:Group1:Tag) metadata names are not required but are helpful to avoid ambiguity.

Your last 10 executed commands are saved in the Command History drop down menu. Instead of checking boxes, you may simply select a command from Command History. In that case, the checkboxes are ignored and the selected command is used.

Once you have selected options and customized operations or chosen a command from history, press the Next button to review the constructed command line.




Review and Edit the Command Line



The Command Runner screen displays your constructed command line. If it is not correct you may press Cancel to return to the Command Builder or edit it in place. If it is OK then press Run ExifTool.




Run ExifTool and Review ExifTool Output



The output of ExifTool is presented in the bottom pane. The quantity of output depends on verbosity and formatting options.




Saved Custom Commands

You may save your own commands in the Tag Operations table. They will appear every time you use the command builder. Put your commands in "exiftool.txt" in the database folder. (The default database folder is ".fastphototagger.") Two lines per command. Line 1: Description. Line 2: ExifTool options and commands. The options and commands text consists of everything on the command line between exiftool and the list of selected files. For example:
Copy Filename to Caption-Abstract
-overwrite_original_in_place -IPTC:Caption-Abstract<File:System:FileName



More Examples

1. Copy metadata from a "reference file." A reference file contains metadata values that you use again and again, similar to a Metadata Template.
(Hint: One way to create a useful reference file is to delete all the metadata in the reference file (#8 below), then set only the metadata fields in the reference file that you will wish to copy.)

Copy Copyright and Creator from the reference file to the selected files:
-tagsFromFile C:\Users\pc\photos\reference.jpg -MWG:Copyright -MWG:Creator

Copy all tags from the reference file: (Be sure your reference file is properly prepared using the hint above. Otherwise you may not like the results.)
-tagsFromFile C:\Users\pc\photos\reference.jpg -all:all


2. Copy the filename to XMP:Title:
-XMP:Title<FileName

Copy the filename to XMP:Title removing any 3 or 4 character extension:
-XMP:Title<${FileName;s/\.(...|....)$//i}

3. Add 1 hour to the times in DateTimeOriginal, CreateDate, and ModifyDate:
-AllDates+="0:0:0 01:00:00"

4. Rename files to their create date, e.g., 20190623_152738.jpg: (This is handy when merging photos from multiple cameras with different naming conventions.)
-FileName<CreateDate -d "%Y%m%d_%H%M%S%%-c.%%e"

5. Geotag photos using a GPS tracking log. ExifTool recognizes a variety of tracking log formats. This example writes GPS information from the tracking log to the selected files:
-geotag C:\Users\pc\photos\track.log

In addition, you can apply time corrections to your data using -geosync and -geotime. See https://exiftool.org/geotag.html.

6. Geotag photos from a reference file.
-tagsFromFile "C:\GPS\reference.jpg" -GPSLatitude -GPSLatitudeRef -GPSLongitude -GPSLongitudeRef -GPSAltitude -GPSAltitudeRef -MWG:Location -MWG:City -MWG:State -MWG:Country

7. Generate a CSV (comma-separated values) file, for example with keywords and caption (those are two single quotes):
-csv -IPTC:Keywords -IPTC:Caption-Abstract -ImageSize -f -api MissingTagValue='' -sep ; -csvDelim \t
Then copy the results into an empty csv file.

8. Import values from a CSV file (those are two single quotes):
-a -G0:1 -overwrite_original_in_place -s -f -api MissingTagValue='' -csvDelim \t -sep ; -csv=filesss
Instead of filesss you may enter a full path to the csv file.
This is tricky: In the CSV file, cells containing '' are imported as empty values; empty cells are ignored.

9. Delete all metadata. You should NOT do this to RAW images, except DNG.
-all=

10.Run ExifTool's file validation test. ExifTool is not an image validator but it can do some correctness checks, mainly for JPEG and TIFF-format images.
-validate -warning -error

10. Attempt to repair files. ExifTool is not an image repair program but may be used to fix some problems in image files. Some metadata from the original image may be lost in the process. Read the ExifTool documentation.
-all= -tagsfromfile @ -all:all -unsafe -icc_profile -thumbnailimage -F




Some Notes

o Always use full pathnames to files and folders, e.g., C:\Users\dennis\Pictures\IMG-123.jpg, not IMG-123.jpg.

o Fully qualified (Group0:Group1:Tag) metadata names are not required but are helpful to avoid ambiguity. Using IPTC:Keywords is preferable to just Keywords.

o When copying a field with non-English characters to an IPTC field, you may also need to add this option: -IPTC:CodedCharacterSet=UTF8.

o The current folder will reload after exit from the Command Builder.