PrintEXIF Script

PrintEXIF is a script for Adobe® Photoshop® that automates the presentation of shooting information (EXIF) for either a photo that is targeted for the Web or a photo that will be printed. PrintEXIF creates a frame around the photograph and “prints” shooting information – EXIF data – in the bottom of the frame. It uses both standard EXIF data and data that has been recorded in the IPTC Caption field by Nikon Transfer.

The current version is v2.0. Install the script in the Program Files>Adobe>Adobe Photoshop CS2>Presets>Scripts folder (PC) or Applications>Adobe Photoshop CS2>Presets>Scripts folder (Mac). Once installed, the script can be found in the File>Scripts menu of Photoshop. The script will not appear in the File>Scripts menu until you restart Photoshop. It will run on a PC running Windows XP and on a Mac running OS X. It is written for Photoshop CS2 and will soon will be compatible with CS3.

download-button

Here’s an image that was framed using PrintEXIF:

And here’s the user interface dialog box:

printexif_gui

Overview

What It Does

PrintEXIF is a script for Photoshop CS2 that automates the presentation of shooting information (EXIF) for either a photo that is targeted for the Web or a photo that will be printed. PrintEXIF creates a frame around the photograph and “prints” shooting information – EXIF data – in the bottom of the frame. It uses both standard EXIF data and data that has been recorded in the IPTC Caption field by Nikon Transfer (see Using Nikon Transfer with PrintEXIF).

When the script is run, a dialog box offers a variety of user options. The main or general options are selected in the top portion of the dialog box, labeled “PrintEXIF Options”. One of two positions for the copyright/signature – left or right justified in the photo (default) – can be selected. If the “Copyright/signature only” option is selected, running the script will produce an image with only that information. The frame color can be selected from one of several options and the “Copyright/signature color” and “Title & EXIF info color” can be selected from drop down lists. Drop down lists also allow the selection of “Copyright/signature font”, “Title font” and “EXIF info font”. The font sizes for the title and copyright are, by default, the same. The font size for the EXIF info is smaller than the font size for the title and copyright/signature. The two font sizes can be changed by the user. The three text layers (title, copyright/signature, EXIF info) are flattened at the end of the script (default), but the user can choose not to flatten the layers.

The next option that can be changed from the dialog box is the lens description. By default, the script reads the lens description from the information in the IPTC Caption field. If the default lens description is not available (“Undetermined lens”) or if the user desires to change the lens description, a new lens can be selected from a drop down list. If a teleconverter was used for the shot, the user can select one of three (Nikon) teleconverters. The script uses the file name, by default, as the title. If a new title is desired, a title can be entered. Finally, a logo can be selected to be printed in the lower right corner of the frame.

Customization

The script can be customized by the user in several ways (see Customizing PrintEXIF, Adding Lenses, and Logos). At a minimum, the user’s name should be substituted in the script for the default signature, “Your Name Here”. Customizations require the user to edit the script using Notepad (Windows), TextEdit (Mac) or Adobe’s ExtendScript Toolkit (either platform). After editing, the script should be saved as a “.jsx” file.

Installation

To install, copy the script to the Program Files>Adobe>Photoshop CS2>Presets>Scripts folder (Windows PC) or Applications>Adobe Photoshop CS2>Presets>Scripts folder (Mac) (see Installing & Using PrintEXIF). The script is compatible with Nikon DSLRs. It has not been tested with earlier versions of Photoshop or other DSLR’s. The script is written in JavaScript and will run on both Windows and Mac OS.

History

The origins of this script are in the Digital Photography Review Nikon D1/D2/D100/D200 Forum. PrintEXIF makes liberal use of ideas and portions of scripts from several DPReview forum members. I take no credit for the original idea of the EXIF extraction script nor do I derive any monetary value from PrintEXIF. My intent is solely to provide a useful tool to fellow photographers that can be freely used and easily modified.

In that regard, this is freeware. This freeware is distributed as is and with no warrantees of any kind, whether express or implied. The user must assume all responsibility for the entire risk of using this freeware whether to their property or to the property of others. The author does not accept any liability relating to the use of this freeware; this is to be assumed by the individual or organization making use of it.

Installing & Using PrintEXIF
1. Download and un-zip the compressed PrintEXIF zip file.
2. Copy the PrintEXIFv2.0.jsx file to the Program Files>Adobe>Photoshop CS2>Presets>Scripts folder (Windows PC) or the Applications>Adobe Photoshop CS2>Presets>Scripts folder (Mac).
3. Open Photoshop CS2 and open an image file. Process and resize the image to its final size.
4. From the File>Scripts menu of Photoshop CS2 select PrintEXIFv2.0.
5. The script will run, bringing up a dialog box.
6. From the dialog box, select the desired options (or use the defaults).
7. Click “OK” and the script will finish with a framed image. The text layers are flattened by default, but the user may choose not to flatten the layers to allow subsequent modification in Photoshop.

Using Nikon Transfer with PrintEXIF
Nikon Transfer is bundled with the Nikon View software, so it is necessary to install Nikon View even if you don’t intend to use it as an image browser. The following instructions assume that a CF card with Nikon DSLR image files has been loaded into a card reader that is connected to the PC or Mac. Close any Auto Play dialog box that appears or choose the selection that always uses Nikon Transfer to transfer image files (Windows).
1. If Nikon Transfer does not automatically open, open Nikon View and go to the Tools menu. Select “Launch Nikon Transfer … ”
2. Click on the “screwdriver and wrench” icon in the upper right corner of the dialog box (“transfer options”).
3. A new dialog box will appear. Click on the Transfer tab.
4. Select all of the options, including the one that says, ” Copy shooting data …”. Click “OK”.
5. An optional step is to add more personal information to the IPTC fields about yourself. To do that, click on the ” i” icon in the upper right corner of the initial Nikon Transfer dialog box.
6. Click “Details”.
7. Add any information that you want to be imbedded in your image files (name, copyright info, location, etc.) EXCEPT in the Caption field. Leave the Caption field blank. Click “OK”. You will be returned to the initial Nikon Transfer dialog box.
8. At this point you may want to change the folder and file names of the image files and folders that will reside on your PC or Mac. Click on the “Change” button and in the dialog box set the options to be compatible with your workflow. Click “OK”. In the initial Nikon Transfer dialog box, click the yellow double headed arrow button and the transfer will begin.
10. The images will be tranferred to the designated folder on your PC or Mac and the IPTC Caption field will have the shooting data (EXIF) that PrintEXIF needs.

Customizing PrintEXIF

Copyright/Signature
To change the signature/copyright, open the PrintEXIF script using a text editor (Notepad or equivalent) or Adobe’s ExtendScript Toolkit. Find the following code near the beginning of the script:

///////////////////////////////////////////////////////////////////////////////
// USER CUSTOMIZATION
// Replace "Your Name Here" (keep the quotes) with your copyright name
// The script will determine the year from the EXIF information
// and will prefix the copyright with the copyright symbol, "©"
///////////////////////////////////////////////////////////////////////////////
SIGNATURE = "Your Name Here"

Change “Your Name Here” to your name (keep the quotes) and click “Save”.
PrintEXIF will append the correct year and the copyright symbol.

To change the default fonts and colors, open the PrintEXIF script using a text
editor and find the following code near the beginning of the script:

///////////////////////////////////////////////////////////////////////////////
// DEFAULT FONTS AND COLORS
///////////////////////////////////////////////////////////////////////////////
// Default signature/copyright font
defaultSigFont = 0
// Default EXIF info font
defaultInfoFont = 0
// Default title font
defaultTitleFont = 0
// Default signature/copyright color
defaultSigColor = 1
// Default EXIF info and title color
defaultInfoColor = 1
// Default frame color
defaultFrameColor = 3

For fonts, change the number to the number of the desired font. Arial = 0,
Arial Black = 1, Mistral = 2, Tahoma = 3, Times New Roman = 4, and Verdana = 5.
For colors, Black = 0, White = 1, Light Gray = 2, Neutral Gray = 3,
Dark Gray = 4, Red = 5, Green = 6, Blue = 7, and Yellow = 8. Click “Save”
after making changes.

To add or delete fonts, open the PrintEXIF script using a text editor and find
the following code near the beginning of the script:

///////////////////////////////////////////////////////////////////////////////
// FONTS
// Fonts are stored as two arrays.  The first array "fontItemName" holds the
// common name of the font.  This name is the name that appears in the drop down
// list to select the font.  The second array holds the corresponding
// Postscript name of the font. New fonts can be added by adding the common name
// to the first array as "fontItemName[a]" where "a" is the next number in the
// sequence, and adding the Postscript name to the second array as "fontItem[a]"
// where "a" is the next number in the sequence.
///////////////////////////////////////////////////////////////////////////////
var fontItemName = new Array()
fontItemName[0] = "Arial"
fontItemName[1] = "Arial Black"
fontItemName[2] = "Mistral"
fontItemName[3] = "Tahoma"
fontItemName[4] = "Times New Roman"
fontItemName[5] = "Verdana"
var fontItem = new Array()
fontItem[0] = "ArialMT"
fontItem[1] = "Arial-Black"
fontItem[2] = "Mistral"
fontItem[3] = "Tahoma"
fontItem[4] = "TimesNewRomanPSMT"
fontItem[5] = "Verdana"

Fonts are represented by a pair of names, the first being the name that appears in the drop down selection list (Arial for example), and the second being the Postscript name of the font (ArialMT for example). To determine the Postscript name of a font on your system, copy the following script to a text editor (Notepad for example) or Adobe’s ExtendScript Toolkit:

docRef = activeDocument;
if (docRef.activeLayer.kind == LayerKind.TEXT)
{
alert("Font name is " + app.fonts[docRef.activeLayer.textItem.font].name + "n" +
"Postscript name is "+ app.fonts[docRef.activeLayer.textItem.font].postScriptName + "n" +
"Style is " + app.fonts[docRef.activeLayer.textItem.font].style+ "n" +
"Anti-alias is " + docRef.activeLayer.textItem.antiAliasMethod);
}
else
{alert("Active layer is not a text layer");
}

Save the script using a name you will recognize (like “FindName” or “PostscriptName”) as a .jsx file. When using Notepad (Windows) or TextEdit (Mac), make sure the Unicode encoding option is selected in the “Save As” dialog box (Windows). Copy the script to the Program Files>Adobe>Photoshop CS2>Presets>Scripts folder (Windows PC) or the Applications>Adobe Photoshop CS2>Presets>Scripts folder (Mac). Open Photoshop and create a new document with a text layer using the font you want to add. Select File>Scripts and select the script you have saved (e.g., FindName or PostscriptName). An alert box will appear giving the font name and the Postscript name along with other properties of the font. Use the font name as a new item in the first array and the Postscript name as a new item in the second array.

If you delete a font, delete both array entries. Also, renumber the array items so that the numbers in each array are contiguous. Make sure the font name in the first array matches the Postscript name in the second array. Click “Save” after making changes.

Colors are handled in a similar fashion. Find the following code near the beginning of the script:

///////////////////////////////////////////////////////////////////////////////
// COLORS
// For a new color, a SolidColor needs to be declared by either specifying the
// RGB values independently like "yellow" or linked like "black" (see below).
// The color names are stored in two arrays, "colorItemName" and "colorItem".
// New colors can be added by adding a SolidColor and a corresponding entry
// in each array.  The names in the colorItemName array appear in the drop down
// list to select colors.
///////////////////////////////////////////////////////////////////////////////
var black = new SolidColor()
black.rgb.red = black.rgb.green = black.rgb.blue = 0
var white = new SolidColor()
white.rgb.red = white.rgb.green = white.rgb.blue = 255
var lightGray = new SolidColor()
lightGray.rgb.red = lightGray.rgb.green = lightGray.rgb.blue = 192
var neutralGray = new SolidColor()
neutralGray.rgb.red = neutralGray.rgb.green = neutralGray.rgb.blue = 128
var darkGray = new SolidColor()
darkGray.rgb.red = darkGray.rgb.green = darkGray.rgb.blue = 64
var yellow = new SolidColor()
yellow.rgb.red = 255, yellow.rgb.green = 255, yellow.rgb.blue = 0
var red = new SolidColor()
red.rgb.red = 255, red.rgb.green = 0, red.rgb.blue = 0
var blue = new SolidColor()
blue.rgb.red = 0, blue.rgb.green = 0, blue.rgb.blue = 255
var green = new SolidColor()
green.rgb.red = 0, green.rgb.green = 255, green.rgb.blue = 0
var colorItemName = new Array()
colorItemName[0] = "Black"

colorItemName[1] = "White"
colorItemName[2] = "Light Gray"
colorItemName[3] = "Neutral Gray"
colorItemName[4] = "Dark Gray"
colorItemName[5] = "Red"
colorItemName[6] = "Green"
colorItemName[7] = "Blue"
colorItemName[8] = "Yellow"
var colorItem = new Array()
colorItem[0] = black
colorItem[1] = white
colorItem[2] = lightGray
colorItem[3] = neutralGray
colorItem[4] = darkGray
colorItem[5] = red
colorItem[6] = green
colorItem[7] = blue
colorItem[8] = yellow

A new color must first be defined by its RGB values. If the values are the same (black for example), you can define the color as follows:

var black = new SolidColor()
black.rgb.red = black.rgb.green = black.rgb.blue = 0

If the values are not the same (yellow for example), you can define the color as follows:

var yellow = new SolidColor()
yellow.rgb.red = 255, yellow.rgb.green = 255, yellow.rgb.blue = 0

After defining a new color, an array entry must be made in the two color arrays. The first array holds the name that appears in the drop down selection list and the second name holds the name of the color variable. The color variable must begin with a lower case letter and contain no spaces or special characters. Click “Save” after making changes.

Additional Customization
An additional level of customization is possible by choosing not to flatten the text layers and changing the information, fonts and/or font sizes in Photoshop CS2.

Adding Lenses
The lens list contained in the PrintEXIF script contains all of the current Nikon lenses listed on the Nikon website:

///////////////////////////////////////////////////////////////////////////////
// LENSES
// Nikon's current lens lineup as of September 2005.  Additional lens can be entered
// in the list by typing the lens description between the quotation marks (see below).
// The lens then appears in the drop down list selection box when the script is run.
// To add a separator, type "-" as the lens description.
///////////////////////////////////////////////////////////////////////////////
var lensItem = new Array ()
lensItem[0] = "Select lens from list"
lensItem[1] = "14mm F/2.8D"
lensItem[2] = "16mm F/2.8D Fisheye"
lensItem[3] = "18mm F/2.8D"
lensItem[4] = "20mm F/2.8D"
lensItem[5] = "24mm F/2.8D"
lensItem[6] = "28mm F/1.4D"
lensItem[7] = "28mm F/2.8D"
lensItem[8] = "35mm F/2D"
lensItem[9] = "-"
lensItem[10] = "50mm F/1.4D"
lensItem[11] = "50mm F/1.8D"
lensItem[12] = "85mm F/1.4D"
lensItem[13] = "85mm F/1.8D"
lensItem[14] = "105mm F/2D DC"
lensItem[15] = "135mm F/2D DC"
lensItem[16] = "180mm F/2.8D"
lensItem[17] = "-"
lensItem[18] = "300mm F/4D"
lensItem[19] = "300mm F/2.8D"
lensItem[20] = "400mm F/2.8D"
lensItem[21] = "500mm F/4D"
lensItem[22] = "600mm F/4D"
lensItem[23] = "-"
lensItem[24] = "17-35mm F/2.8D"
lensItem[25] = "18-35mm F/3.5-4.5D"
lensItem[26] = "-"
lensItem[27] = "24-85mm F/2.8-4D"
lensItem[28] = "24-85mm F/3.5-4.5G"
lensItem[29] = "28-70mm F/2.8"
lensItem[30] = "28-80mm F/3.5-5.6G"
lensItem[31] = "28-100mm F/3.5-5.6G"
lensItem[32] = "28-105mm F/3.5-4.5D"
lensItem[33] = "28-200mm F/3.5-5.6G"
lensItem[34] = "35-70mm F/2.8D"
lensItem[35] = "-"
lensItem[36] = "70-300mm F/4.5-5.6D"
lensItem[37] = "70-300mm F/4.5-5.6G"
lensItem[38] = "80-200mm F/2.8D"
lensItem[39] = "-"
lensItem[40] = "12-24mm F/4G DX"
lensItem[41] = "10.5mm F/2.8G DX Fisheye"
lensItem[42] = "18-70mm F/3.5-4.5G DX"
lensItem[43] = "18-55mm F/3.5-5.6G DX"
lensItem[44] = "17-55mm F/2.8G DX"
lensItem[45] = "55-200mm F/4-5.6G DX"
lensItem[46] = "-"
lensItem[47] = "VR 200mm F/2G"
lensItem[48] = "VR 300mm F/2.8G"
lensItem[49] = "VR 24-120mm F/3.5-5.6G"
lensItem[50] = "VR 70-200mm F/2.8G"
lensItem[51] = "VR 80-400mm F/4.5-5.6D"
lensItem[52] = "VR 200-400mm F/4G"
lensItem[53] = "-"
lensItem[54] = "60mm F/2.8D Micro"
lensItem[55] = "105mm F/2.8D Micro"
lensItem[56] = "200mm F/4D Micro"
lensItem[57] = "-"
lensItem[58] = "24mm F/2 AI-S"
lensItem[59] = "28mm F/3.5 PC AI-S"
lensItem[60] = "28mm F/2 AI-S"
lensItem[61] = "35mm F/1.4 AI-S"
lensItem[62] = "45mm F/2.8P AI-S"
lensItem[63] = "50mm F/1.2 AI-S"
lensItem[64] = "85mm F/1.4 AI-S"
lensItem[65] = "85mm F/2.8 PC Micro"
lensItem[66] = "105mm F/2.5 AI-S"
lensItem[67] = "135mm F/2.8 AI-S"
lensItem[68] = "200mm F/4 Micro AI-S"
lensItem[69] = "500mm F/8N Reflex"
lensItem[70] = "35-200mm F/3.5-4.5 AI-S"
lensItem[71] = "70-210mm F/4.5-5.6 (For FM-10)"

The simplest way to add a lens is to add an item at the end of the array. For example:

lensItem[72] = "Sigma 50-500mm F/5.6"

Or you can delete an array item and replace it with another lens. For example, change

lensItem[71] = "70-210mm F/4.5-5.6 (For FM-10)"

to

lensItem[71] = "Sigma 50-500mm F/5.6"

You may want to simplify the list to only those lenses you own. Just delete the unwanted items in the array and renumber the array so that the items are contiguous. To add a separator, type “-” as the lens description (keep the quotes). Click “Save” after making changes.

Logos
This version of PrintEXIF introduces the option of putting a logo or other small image in the bottom frame. The logo will be placed in the lower right corner of the frame and should be about 50-100 pixels on the longest side for an 800 x 533 pixel image. You can experiment with different logo dimensions to determine what works for you.

Frequently Asked Questions (FAQ)

1. How do I change the copyright name?
Answer: See the explanation above.

2. Where does the script go?
Answer: See the explanation above.

3. Does this work with earlier versions of Photoshop or with Photoshop Elements?
Answer: No, because those versions don’t have a scripting environment or recognize the ScriptUI interface.

4. Do I have to use Nikon Transfer?
Answer: Nikon Transfer isn’t necessary, but without Nikon Transfer, the script does not “print” as much shooting information. The script relies on Nikon Transfer recording the shooting information to the IPTC Caption field. For example, the lens description is not contained in the standard EXIF and is only extracted if Nikon Transfer has been used to record the shooting information in the IPTC Caption field.

5. How do I find the script in Photoshop CS2?
Answer: Go to the Files>Scripts menu and the PrintEXIF script should be listed as a selection in the drop-down menu (if you’ve copied the script to the proper folder as specified above).

6. Can I change the font size and color?
Answer: The font size is calculated by the script for the two font sizes: EXIF info and title/copyright. If you want to change the font sizes from the default sizes, you can do that from the dialog box that appears when you run the script. The font types can be changed by changing the constants at the beginning of the script (using the Notepad text editor on a Windows PC or TextEdit on a Mac) that specify fonts for the info, title and copyright. Note that PostScript font names are not always the same as the font name that you’re accustomed to seeing in type specification (“Arial” for example should be coded in the script as “ ArialMT”). If you’re familiar with JavaScript, there is optional code in the script that can be run to find the PostScript names of the fonts on your system.

7. Does the script work on a Mac?
Answer: Yes, it’s written in JavaScript and will work on Mac OS-X running Photoshop CS2.

8. I get an error message when I run the script. What should I do?
Answer: If you get a JavaScript error message when you run the script, try re-downloading the script and re-installing it. If you continue to get the error message, please contact me with the details.

9. Some of my EXIF data doesn’t show up in the frame. Why?
Answer: Every editing program seems to alter EXIF in some way. Since the script depends on certain EXIF fields being intact and in a certain place, it has trouble when the fields have been altered or rearranged. That’s why most of the data is pulled from the IPTC Caption field.

10. Can you add “xyz” feature?
Answer: Possibly. There are inherent limitations in the Photoshop scripting environment and to the amount of useful information that can be easily derived from the EXIF and IPTC metadata. I will try to add features that are useful to the photographic community.

11. Can I change the copyright date ?
Answer: The script picks up the year from the EXIF information and uses the year that the image was originally taken. You shouldn’t need to change it.

12. Is the shooting information in the IPTC Caption field different for each Nikon DSLR?
Answer: Unfortunately yes. The script has been written to find the shooting information for each Nikon DSLR camera type.

13. Will the script work with the D100 (D1X, D2H, D2Hs, D2X, D2Xs, D70, D…)?
Answer: Yes, if the EXIF data has been written to the IPTC Caption field by Nikon Transfer.


Adobe and Photoshop are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.

This entry was posted in Uncategorized and tagged , , , , , .