Alyda

Just a Girl Weblog

Remembering Who I Really Am

Viewing Auto Bracket Information in Lightroom

Lightroom displays the exposure compensation metadata in a field they call Exposure Bias. Unhappily, the value of this tag also contains the auto bracket metadata making it difficult to use these values in a meaningful way. In addition, Exposure Bias does not appear as Metadata criteria in the Library Filter bar.

Lightroom Keywords
Lightroom Keywords

There are many presets, templates and plugins available for Lightroom which extend the functionality but may be costly, are version dependant, or—worst case—allow you to change the labels in the metadata panel and invite you to enter values that are mapped incorrectly!

A simpler solution is to write the values of these tags to Keyword tags. The keyword tag can be read by Lightroom, Photoshop, Bridge, and Elements.

Adding Keywords to RAW files

ExifTool

ExifTool is a platform‑independent command‑line application for reading, writing, and editing meta information contained in image, audio and video files. You can download this neat little tool here. For help installing ExifTool on Windows, Mac OS X and Unix systems, read the instructions here.

User‑defined tags can not be defined at the command line. But after you define them in the exiftool config file you can use them at the command line. The only difference in the configuration and implementation of the command (aside from the camera make) is in the use of single versus double quotes. They are critical, so copy carefully.

The Configuration File

Copy and paste the following into your text editor:

Nikon
  • %Image::ExifTool::UserDefined = (
  • 'Image::ExifTool::Composite' => {
  • EC => {
  • Require => {
  • 0 => 'ExposureBracketValue',
  • 1 => 'EXIF:ExposureCompensation',
  • },
  • ValueConv => '$val[1] - $val[0]',
  • PrintConv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  • },
  • },
  • );
  • 1; #end
Canon
  • %Image::ExifTool::UserDefined = (
  • 'Image::ExifTool::Composite' => {
  • EC => {
  • Require => {
  • 0 => 'AEBBracketValue',
  • 1 => 'EXIF:ExposureCompensation',
  • },
  • ValueConv => '$val[1] - $val[0]',
  • PrintConv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  • },
  • },
  • );
  • 1; #end

To activate this file, save it as ".ExifTool_config" in the same directory as the exiftool application (Windows) or your home directory (Mac).

Note: The Windows GUI won't let you use a file name beginning with a dot ("."), so you must first save the file with a different name (i.e., 'ExifTool_config.txt'), and then rename it using the "rename" command in a cmd shell. Alternatively, the txt file may be loaded using the ‑config option (see below).

Implementation

Caution: Do not proceed unless you already have separate backup copies of your image files. Your backup copies can safely be replaced with the keyworded version after you've confirmed that your images will open in your post‑processing software application.

Command Line Version ‑ Mac or PC
  • Open the cmd shell (Windows) or start the Terminal application (Mac).
  • Change to the photo directory. Windows or Mac: type 'cd' (without the quotes) followed by a space, drag and drop your photo directory into the window, and then press Enter.
  • Copy and paste the appropriate exiftool command (below) into the window.

Note: If you are using the txt version of the configuration file, modify the command by inserting '‑config ExifTool_config.txt ' (without the quotes) immediately before the ‑sep option.

Nikon ‑ Mac
  • exiftool -sep ", " '-keywords+=Bracketed, EBV: ${Nikon:ExposureBracketValue}, EC: ${EC}' -overwrite_original -if '$Nikon:ShootingMode =~ "Exposure Bracketing"' *.NEF
Nikon ‑ PC
  • exiftool -sep ", " "-keywords+=Bracketed, EBV: ${Nikon:ExposureBracketValue}, EC: ${EC}" -overwrite_original -if "$Nikon:ShootingMode =~ 'Exposure Bracketing'" *.NEF
Canon ‑ Mac
  • exiftool -sep ", " '-keywords+=Bracketed, EBV: ${Canon:AEBBracketValue}, EC: ${EC}' -overwrite_original -if '$Canon:AutoExposureBracketing =~ "On"' *.CR2
Canon ‑ PC
  • exiftool -sep ", " "-keywords+=Bracketed, EBV: ${Canon:AEBBracketValue}, EC: ${EC}" -overwrite_original -if "$Canon:AutoExposureBracketing =~ 'On'" *.CR2
Drag and Drop Version ‑ PC Only

Rename the exiftool(‑k).exe file you downloaded as shown below, and then drag and drop your photo file(s) or folder onto the file.

Note: If you are using the txt version of the configuration file, modify the command by inserting '‑config ExifTool_config.txt ' (without the quotes) immediately before the ‑sep option.

Nikon
  • exiftool(-sep ", " "-keywords+=Bracketed, EBV: ${Nikon:ExposureBracketValue}, EC: ${EC}" -overwrite_original -if "$Nikon:ShootingMode =~ 'Exposure Bracketing'" *.NEF).exe
Canon
  • exiftool(-sep ", " "-keywords+=Bracketed, EBV: ${Canon:AEBBracketValue}, EC: ${EC}" -overwrite_original -if "$Canon:AutoExposureBracketing =~ 'On'" *.CR2).exe

How it Works

The config file defines a new tag called 'EC' which takes its value from a composite of the bracket value and exposure compensation tags after subtracting one from the other. Then, if necessary, the fraction is converted. So, for example, a bracket value of '1' and a compensation value of '1 1/3' yields a corresponding EC value of '1/3.' The ValueConv expression may be any valid Perl expression—it returns the converted value given the original value ($val) of the Require'd tags. The 'EBV' value is read from the tag in the command itself.

The command options can be interpreted as follows:

  • ‑sep: Specify the separator string for items in List‑type tags. When writing metadata, this option causes values assigned to list‑type tags to be split into individual items at each substring matching the specified separator.
  • ‑keywords: The '‑keywords' operation of the command adds keywords to the original file. 'EBV' takes its value from the 'ExposureBracketValue' (Nikon) or 'AEBBracketValue' (Canon). 'EC' is calculated in the config file (described above).
  • ‑overwrite_original: Overwrite the original file (instead of preserving it by adding '_original' to the file name) when writing information to an image. Caution: This option should only be used if you already have separate backup copies of your image files. The overwrite is implemented by renaming a temporary file.
  • ‑if: Specifies the condition to be evaluated before processing each file. If the 'ShootingMode' tag includes the text 'Exposure Bracketing' (Nikon) or the 'AutoExposureBracketing' tag is 'On' (Canon), write the Bracketed, EBV and EC keywords to the file. If the condition is not met, the file is skipped.

See List-type tags do not behave as expected for more on the ‑sep and ‑keywords options.

Filed under: , , ,