Image Variables

From CameraBits
Jump to: navigation, search

Concept

The concept of variables is a simple but powerful one. A Variable is simply a symbolic representation of metadata contained within the photos themselves.

For example: {filename} is a Variable and is simply the actual file name of a particular photo. Each photo will of course have a different name so we use the Variable {filename} to refer to whatever the filename happens to be. The convention used in Photo Mechanic is to enclose the variable name in curly brackets like this { }.

There are a great many different Variables and some even have subtle variations: Consider a file named ABC123.jpg

{filename} or {file} = ABC123.jpg
{filenamebase} or {fbas} = ABC123

This could be very useful for creating a printed contact sheet because you could use the Variable {fbas} to label each image so that it would print the file name only, without the file extension, for a more professional look.

Variables are commonly used during the Ingest renaming process to generate new filenames so that certain data contained in each file can be used to derive a new filename. It would be possible to use {datesort}_{frame4}_{user} to make a filename based on the date of capture in a YYYYMMDD format plus the 4 digit frame number plus the name of the camera owner (if defined in the menu of your camera).

So, a shot taken on Jan 1st, 2006 and originally named _Y123456.CR2 would be renamed to 20060101_3456_nick.CR2 which is easy to sort on date order and clearly names the photographer, while keeping the unique file number from the camera.

Any combination of Variables is possible and Photo Mechanic makes it easy to customize your file naming in any way you see fit depending on the job at hand.

Variables can be used in many different places in Photo Mechanic, mainly in Ingesting, Renaming, Copying, FTPing, Exporting, the Info Panel (Preview window), the IPTC Stationery Pad, Printing, Save As and in Slide Show captions. When variables are available for use there will be a Variables button in the dialog box. Clicking this brings up a Variables list. To enter a variable in a field you can either type it in using the { } symbols or, simply double-click on the Variable you want in the list and it will be inserted into whichever field was active in the dialog box.

Note that highlighting a Variable in the list will reveal a brief description in the pane at the top of the list.

Client/User Variables enable you to define Variables for jobnames, clients, your business name, even phone numbers and email addresses.

Variable Substring Extraction

Substring extraction can be used to ‘extract’ a range of characters from an image variable so they can be used as normal variables in other fields throughout Photo Mechanic.

The format is: {variable:index,count:conversion} or {variable:index:conversion}

In either case, <:conversion> is optional.

<index> Sets the point in the string at which the operation starts - zero (0) will include all characters, 1 will ignore the first character etc. This value can be positive or negative. Negative numbers count back from the end of the string, positive numbers count from the beginning.

<count> to extract <count> characters from <index>. <count> may be positive or negative. If <count> is negative then it trims off |<count>| characters from the end of the string. <count> may also be omitted altogether which indicates extracting the substring from <index> position to the end of the string. <conversion> may be one of the following types or may be omitted altogether:

“lc” perform lower-case conversion of all applicable characters
“UC” perform upper-case conversion of all applicable characters
“PC” perform Proper Name case conversion

Here are some examples:

Let’s say we have a file named DSC_1234.JPG

So the variable for {filename} would yield DSC_1234.JPG and {filenamebase} would be DSC_1234

Then to extract substrings from this:

{filenamebase:0,3} yields: DSC
{filenamebase:-4,4} yields: 1234
{filenamebase:-4} yields: 1234
{filenamebase:2,3} yields: C_1
{filenamebase:0:lc} yields: dsc_1234
{filenamebase:0:PC} yields: Dsc_1234
{filename:0,-4} yields: DSC_1234

Variables List

Types of Variables

  • Camera or Image-specific
  • APEX Values
  • Standard IPTC Fields (Also: See the IPTC Variables Map)
  • Time and Date
  • ICC Profile
  • Special
  • GPS
  • Location taken
  • User
  • Client
  • Nikon Picture Control settings

Camera or Image-Specific

actuations, act Number of shutter actuations for the camera.
aperture, f Aperture setting of photo. (from the EXIF data)
aspect, aspt Aspect Ratio of photo
aspectcrop, aspc Aspect Ratio of cropped photo
brightness, brit, bv Brightness of photo in APEX units. This is exposure value minus ‘film’ sensitivity value
bytes, byte The uncompressed image size of the photo
colormode, cmod The color mode set in the camera
colorclass, color, colr Name of color class for photo
colorclasscolor, clrc HTML color value of color class for photo
colorclassval, colorval, clrv Numeric value of color class for photo
comment, cmnt The comment (written by some cameras)
comp Exposure compensation set by camera
corrupt, crpt Number of invalid extra bytes in a JPEG
cropheight, yc Height of a crop
cropwidth, xc Width of a crop
ev Exposure value in APEX units. This is a combination of aperture and shutter speed (or ISO and scene brightness)
ev100 Exposure value in APEX units, relative to ISO 100. E.g. at ISO 200, this would be {ev} - 1
filename, file Filename of photo with the extension
filenamebase, fbas Filename of photo without the extension
filesize, size File size of the photo
firmware, firm Firmware version of camera that took photo
flash, flsh Flash used
flashcomp, fcmp Flash exposure compensation
focusmode, focus, fmod Focus mode of camera
folder, fldr The folder name for a photo (e.g. the current contact sheet)
foldernum, fldn The folder number for a photo (e.g. first three digits of DCIM folder)
folderpath, fpth The full folder path for a photo (e.g. the current contact sheet)
frame, fnum Frame number of photo
frame4, fnm4 Frame number of photo, last 4 digits
hascrop, hc Value will be 'True' if there is a crop set for this image
height, h, y Height of image in pixels (prior to any rotation drawn by Photo Mechanic)
id Either owner (Canon) or comment (Nikon)
iso ISO (ASA) setting of photo
lens Focal length of lens in mm. This isn’t a 35mm equivalent for non-SLR cameras
lens35, 35mm Equivalent 35mm focal length of lens in mm (Not all cameras record this value)
lenstype, lt Type of lens used
lenstypenum, ltnm Variable to report the lens number for certain Canon and Sigma lenses. (This can be used to create a code replacement for translating a lens ID into a more descriptive string)
lightsource, lsrc Light source
lock Returns 1 if the file is locked on the memory card, and 0 if no lock is found
make Make of camera that took photo
mediatype, mtyp Media type (e.g. still, video)
meteringmode, mmod Metering mode set in camera
model, modl Model of camera that took photo.
owner, ownr Camera’s owner (if defined; same as user)
parentfolderpath, pfpt The full folder path to the parent folder of the folder of the photo (i.e. 2 levels up)
path The full path name of the photo
pixels, pxls Total number of pixels (width * height) for photo, displayed as an exponential multiplier (ex. 4.1M)
prefix, prfx First three characters of file name, excluding any leading ‘_’ character from AdobeRGB photos
printsize, psiz Print size in inches or cms (depends on photo)
printsizecms, pscm Print size in cms
printsizeinches, psin Print size in inches
program, mode, prgm Camera’s program mode for photo
quality, qlty Compression quality for camera JPEGs
rating, stars, rate Star rating of photo
rawplusjpeg, r+j If photo is part of a RAW+JPEG pair then the result is 1, otherwise it is 0.
resolution, res Resolution of file
resolutioncms, rscm Resolution is pixels per cm
resolutioninches, rsin Resolution in pixels per inch
rotation, rot Rotation drawn by Photo Mechanic
serialnum, serial, snum Serial number of camera that took photo
sharpness, shrp Sharpness setting in camera for JPEG and TIFF files
shutter, ss Shutter speed setting of photo, from EXIF data
software, soft Software that produced the photo
sound, snd Sound file attached
tag Tagged state of image (either 1 or 0)
tonecomp, tone Tone compensation (contrast) of photo
type Image type (e.g. JPEG)
uniqueid, uniq Unique 32 char ID written by some cameras
user Camera’s user (if defined; same as owner)
width, w, x Width of image in pixels (prior to any rotation drawn by Photo Mechanic)
whitebalance, white, baln White balance of photo as set by camera or host software
whitemode, whim White balance mode (AUTO or MANUAL)

APEX Values

Some cameras record APEX exposure values for each photo (Additive system of Photographic EXposure). (Learn more about APEX on Wikipedia) Photo Mechanic will store the APEX values in these variables. In cases where the APEX values for Av and Tv are not recorded, Photo Mechanic will calculate them from existing camera settings for exposure time and f-number if possible.

If a camera writes the {tv} and {av} and {bv} values (Exif 0x9201, 0x9202, 0x9203) then they will be displayed directly. If a camera only writes the older Exif tags for Exposure Time and F Number, then PM will compute the {tv}, {av}, and {bv} APEX values from the camera settings.

The {sv} APEX value will always be computed based on ISO.

(Ev = Av + Tv = Bv + Sv)

av APEX aperture value
bv APEX brightness value
ev Exposure value in APEX units. This is a combination of aperture and shutter speed (or ISO and scene brightness)
ev100 Exposure value in APEX units, relative to ISO 100. E.g. at ISO 200, this would be {ev} - 1
sv APEX ISO speed value (a.k.a. sensitivity value)
tv APEX time value

Standard IPTC Fields

assignment, assn JobMinder assignment number (if defined)
byline, name IPTC Byline (Photographer) field
caption, capt IPTC Caption field
captionwriter, cwrt IPTC Caption Writer field
category, cat IPTC Category field
city IPTC City field
citytaken, cttk IPTC City where the image was taken from field
contactaddress, ciad Contact Info Address
contactcity, cicy Contact Info City
contactstate, cist Contact Info State
contactzip, cizp Contact Info ZIP Code
contactcountry, cicn Contact Info Country
contactemail, ciem Contact Info Email
contactphone, ciph Contact Info Phone
contactweb, ciwb Contact Info Web URL
copyright, copy IPTC Copyright field
copyrighturl, curl IPTC URL field
country, cnty IPTC Country field
countrytaken, cntk IPTC Country taken
countrycode, ccod IPTC Country Code field
countrycodetaken, cctk IPTC Country Code taken
credit, cred IPTC Credit field
editstatus, edit IPTC Edit Status field
genre, gene XMP Intellectual Genre field
headline, head IPTC Headline field
instructions, inst IPTC Special Instructions field
iptcampm, iap IPTC day half (AM or PM)
iptcdate, idat IPTC Date field (YYYYMMDD)
iptcday, iday IPTC day (1, 2, 3 .. 31)
iptcday0, idy0 IPTC day zero padded (01, 02, 03 .. 31)
iptcdow, idow IPTC day of week (Sunday, Monday, etc)
iptcdow3, idw3 IPTC day of week abbreviated (Sun, Mon, etc)
iptchour, ihr IPTC 12 hour format (1, 2, 3 .. 12)
iptchour0, ihr0 IPTC 12 hour format zero padded (01, 02, 03 .. 12)
iptchour24, ih24 IPTC 24 hour format zero padded (01, 02, 03 .. 23)
iptcminute, imin IPTC minute (00 .. 59)
iptcmonth, imn IPTC month (1, 2, 3 .. 12)
iptcmonth0, imn0 IPTC month zero padded (01, 02, 03 .. 12)
iptcmonthname, imnn IPTC month name ( January, February, etc)
iptcmonthname3 IPTC month name abbreviated ( Jan, Feb, etc)
iptcmonthnameap IPTC month name abbreviated for AP ( Jan., Feb., etc)
iptcsecond, isec IPTC second (00 .. 59)
iptctime, itim IPTC Time field (HHMMSS+0800)
iptcyear2, iyr2 IPTC year (2 digits)
iptcyear4, iyr4 IPTC year (4 digits)
keywords, keyw IPTC Keywords field
location, loc IPTC Sublocation field
locationtaken, lctk IPTC sublocation taken field
object, objt IPTC Object name field
photog, phtg IPTC Byline field
province, prov IPTC State / Province field
scene, scen IPTC Scene field
slug IPTC Object name field
source, srce IPTC Source field
sourcetype, srct Digital source type
state, stat IPTC State / Province field
statetaken, sttk IPTC State where the image was taken from field
subject, subj IPTC Subject field
suppcat1, sup1 IPTC Supplemental category field 1
suppcat2, sup2 IPTC Supplemental category field 2
suppcat3, sup3 IPTC Supplemental category field 3
title, titl IPTC Byline Title field
transref, tref IPTC Transmission Reference field
urgency, urgc IPTC Urgency field
usage, usag XMP Rights Usage field
worldregiontaken, wrtk World region taken

Time and Date Variables

ampm Capture day half (AM or PM)
date, shot Capture date of photo according to camera or file creation time. The format is the same as the Date & Time control panel’s ‘short date’ setting
datemil, datm Capture date of photo according to camera or file creation time in military format (ddMONyy
datesort, dats Capture date of photo according to camera or file creation time. This can be used for sorting since the format is always YYYYMMDD
day Capture day of photo according to camera or file creation time (1, 2, 3 .. 31)
day0 Capture day zero padded of photo according to camera or file creation time (01, 02, 03 .. 31)
dow Capture day of week of photo according to camera or file creation time (Sunday, Monday, etc)
dow3 Capture day of week (abbreviated) of photo according to camera or file creation time (Sun, Mon, etc)
hour Capture 12 hour format (1, 2, 3 .. 12)
hour0, hr0 Capture 12 hour format zero padded (01, 02, 03 .. 12)
hour24, h24 Capture 24 hour format zero padded (01, 02, 03 .. 23)
minute, min Capture minute (00 .. 59)
moddate, mdat Modification date
modtime, mtim Modification time
moddatesort, mdts Modification date for sorting (YYYYMMDD)
modtimesort, mtms Modification time for sorting (HHMMSS)
month, mn Capture month according to camera or file creation time (1, 2, 3 .. 12)
month0, mn0 Capture month zero padded according to camera or file creation time (01, 02, 03 .. 12
monthname, mnn Capture month name ( January, February, etc)
monthname3, mnn3 Capture month name abbreviated ( Jan, Feb, etc)
monthnameap, mnap Capture month name abbreviated for AP (Jan., Feb., etc)
now Current time. See the Date & Time control panel for formatting
nowampm, nap Current day half (AM or PM)
nowhour, nhr Current 12 hour format (1, 2, 3 .. 12)
nowhour0, nhr0 Current 12 hour format zero padded (01, 02, 03 .. 12)
nowhour24, nh24 Current 24 hour format zero padded (01, 02, 03 .. 23)
nowminute, nmin Current minute (00 .. 59)
nowsecond, nsec Current second (00 .. 59)
nowsort, nows Current time. This can be used for sorting since the format is always HHMMSS in 24-hour format
nowsortlong, nwsl Current time including 1/100 of a second. This can be used for sorting since the format is always HHMMSSss in 24-hour format
nowsubsecond, nsub Current subsecond (00 .. 99)
second, sec Capture second (00 .. 59)
subsecond, ssec Capture sub-second (for cameras that support this)
time Capture time of photo according to camera or file creation time
timesort, tims Capture time of photo according to camera
timesortlong, tmsl Capture time of photo according to camera (long format)
today, tday Current date. The format is the same as the Date & Time control panel’s ‘short date’ setting
todayday, tdy Current day (1, 2, 3 .. 31)
todayday0, tdy0 Current day zero padded (01, 02, 03 .. 31)
todaydow, tdow Current day of week (Sunday, Monday, etc)
todaydow3, tdw3 Current day of week abbreviated (Sun, Mon, etc)
todaymil, tdym Current date in military format (ddMONyy)
todaymonth, tmn Current month (1, 2, 3 .. 12)
todaymonth0, tmn0 Current zero padded month (01, 02, 03 .. 12)
todaymonthname, tmnn Current month name ( January, February, etc)
todaymonthname3, tmn3 Current month name abbreviated ( Jan, Feb, etc)
todaymonthnameap, tmap Current month name abbreviated for AP (Jan., Feb., etc)
todaysort, tdys Current date. This can be used for sorting since the format is always YYYYMMD
todayyear2, tyr2 Current two digit year (e.g. 97, 04)
todayyear4, tyr4 Current four digit year (e.g 1997, 2004)
tomorrow, tmrw Tomorrow’s date. The format is the same as the Date & Time control panel’s ‘short date’ setting
wiredate, wdat Evaluates to {iptcdow}, {iptcmonthnameap} {iptcday}, {iptcyear4}
year2, yr2 Capture year (2 digits) according to camera or file creation time
year4, yr4 Capture year (4 digits) according to camera or file creation time
yesterday, ystd Yesterday’s date. The format is the same as the Date &Time control panel’s ‘short date’ setting

ICC Profile Variables

gamma, gama The gamma of the photo
icc The name of the ICC profile for a photo
prrx The red x coordinate of the primaries
prry The red y coordinate of the primaries
prgx The green x coordinate of the primaries
prgy The green y coordinate of the primaries
prbx The blue x coordinate of the primaries
prby The blue y coordinate of the primaries
wpx The x coordinate of the white point
wpy The y coordinate of the white point

Special Variables

index, indx Index of the photo being processed
ingestseq, iseq Current value of ingest sequence number. This is incremented for each disk being ingested
nl Inserts a new-line (CR) character
page Current page number during printing or exporting of HTML
pagecount Total number of pages during printing or exporting of HTML
rand10 A random number from 01 to 10
rand100 A random number from 001 to 100
rand1000 A random number from 0001 to 1000
sequence, seqn, auto Current value of sequence variable. This will automatically be incremented for the next photo
tab Inserts a tab character
total, totl Total number of photos being processed

GPS Variables

altitude, galt GPS altitude in meters
bearingfrom, bfrm Bearing from photo to home in degrees
bearingto, brto Bearing to photo from home in degrees
distance, dist Distance from photo to home in user’s units
gpsdate, gdat GPS date (UTC) as YYYY:MM:DD
gpsdatum, gdtm GPS map datum
gpsdif, gdif GPS differential correction applied (no or yes)
gpsdir, gdir GPS image direction (0-359 degrees)
gpddirref, gdrf GPS image direction reference (true or magnetic)
gpsdop, gdop GPS degree of data precision
gpsmode, gmod GPS dimension mode (2 or 3)
gpsstatus, gsta GPS status (A=acquiring, V=valid)
gpstime, gtim GPS time (UTC) as HH:MM:SS
gpsversion, gver GPS version
latitude, glat GPS latitude
longitude, glon GPS longitude
satellites, gsat GPS satellites
speed, gspd GPS speed
track, gtrk GPS track (0-359 degrees)

User Variables

jobname, job Current Job name
username, urna User name
usercompany, urco User Company/Name
useraddress, ura1 User Street Address
useraddress2, ura2 User Secondary Address
usercity, urcy User City
userstate,urst User State
userzip, urzip User zip Code
usercountry, urcn User Country
userphone, urph User Phone Number
usermobile, urmb User Mobile Number
userweb, urwb User Website URL
useremail, urem User Email address
usercustom1, urc1 User Custom Field 1
usercustom2, urc2 User Custom Field 2
usercustom3, urc3 User Custom Field 3

Locations Taken

locationtaken, lctk Sublocation taken
citytaken, cttk City the image was taken in
statetaken, sttk State the image was taken in
countrytaken, cntk Country the image was taken in
countrycodetaken, cctk Country Code taken in
worldregiontaken, wrtk World region the image was taken in

Client Variables

clientname, clna Client name
clientcompany, clco Client Company/Name
clientaddress, cla1 Client Street Address
clientaddress2, cla2 Client Secondary Address
clientcity, clcy Client City
clientstate,clst Client State
clientzip, clzip Client zip Code
clientcountry, uscn Client Country
clientphone, clph Client Phone Number
clientmobile, clmb Client Mobile Number
clientweb, clwb Clients Website URL
clientemail, clem Client Email address
clientcustom1, clc1 Client Custom Field 1
clientcustom2, clc2 Client Custom Field 2
clientcustom3, clc3 Client Custom Field 3

Nikon Picture Control Settings Variables

pcnm Picture Control Name
pcad Picture Control Adjustment
pcqa Picture Control Quick Adjust
pcsh Picture Control Sharpness
pccn Picture Control Contrast
pcbr Picture Control Brightness
pcsa Picture Control Saturation
pchu Picture Control Hue Adjustment
pcfe Picture Control Filter Effect
pcte Picture Control Toning Effect
pcts Picture Control Toning Saturation

User/Client Variables

UserClient Variables.jpg

The User / Client Variables dialog is useful when working on different jobs and with different clients when you wish to make sure images are easily trackable. By defining these variables you can use any of this data in the same way as normal variables. User/Client Variables are found at the bottom of the normal Variables pop out list.

The User/Client dialog checks for changes on Cancel and warns on changes. It gives the option to save the changes.

If you have a group of regular clients you could fill in this form for each one, using the Snapshot button to save each set of data. Each time you do a job for a client you can reload the form in two clicks by clicking the Snapshot button again and selecting the client from the list. This will populate all the fields as you last saved them. The User/Client dialog stores/loads the Job name with the Client snapshots.

Having done that you can now use the variables to, for instance, create folder names based on the clients company name or more powerfully, to add data into the IPTC Stationery Pad. Inserting {clientname} {clientcompany} and {clientphone} into, say, the Special Instructions field will tag all the files with your clients name, company and phone number.

Think of User Variables as user-defined text strings that save having to repeatedly enter identical info about you or your clients.

You can get to this dialog by using the “Set User/Client Variables...” command on the Edit menu, or while in the Ingest dialog by clicking on the “Job...” button.

Info Variable

Iptc image info.jpg

If you right-click (Ctrl-click) on a thumbnail you can display Image Info.

This is a sub-menu showing all sorts of information about that particular image. This information also shows up as a mouse-hover tooltip if they are enabled under the View Menu.

Selecting the Show Info Tooltips option in the View Menu causes all the Info Text to display when the mouse is hovered over a thumbnail.

The information that is displayed can be customized using the Edit/Set Info Text menu option.

To edit this list simply select and delete the Variables you don’t want. You can add new Variables by opening the Variables panel and double-clicking the Variable you want to add. The insertion point for a new Variable will be wherever the cursor is flashing in the Set Info dialog.

The sequence of information displayed in the Image Info popup is the same as the sequence set in this dialog. You can edit this list by adding and deleting variables.

Set Info Text.jpg

You can also treat this dialog just like a text editor using the normal Cut, Paste and Copy options, and you can even type directly into the box if you want certain text strings to show up in every image.