Automate showing EXIF with pictures

Started Jan 18, 2005 | Discussions thread
Flat view
Regit Young Veteran Member • Posts: 5,975
Automate showing EXIF with pictures

Sometime ago, Sander asked my about automating the task of showing what kind of lens is being used in the pictures... I didn't know this question till I searched for my name a moment ago!!! Sorry Sander...

In any case, this info may be useful to some... But first, a couple of samples:

In short, you can Basically, I've adapted a javascript (can't remember where the original is from) and you can run this from Photoshop; i.e. File-> Scripts-> Browse

Do remember that this script will work in PS CS, earlier version may need some changes to the way key variables are called/defined. Also, the EXIF info must be well-formed; so directly importing RAW, NC4, etc. is ok. If EXIF is tempered previously, it will not work...

Also, this will be limited as if you have many lenses in the same range, the script can't tell which is which?!?! I've yet to able to extract Max. aperture info, perhaps that may help.

Here's the script. In essence, it is a matter of matching EXIF info with focal length of the lens ... Save the script as something xxx.js and call the script in PS CS, again, File-> Scripts-> Browse

displayDialogs = DialogModes.NO;
var defaultRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;

function explodeArray(item,delimiter) {
tempArray=new Array(1);
var Count=0;
var tempString=new String(item);
while (tempString.indexOf(delimiter)> 0) {

return tempArray;

var AD = activeDocument;
var resRatio = AD.resolution/72;


var heightVar = AD.height.value+2;

var black = new SolidColor(); = = = 0;

var white = new SolidColor(); = = = 255;

backgroundColor = black;


var exifData =;

for(n = 0; n

var stringTemp=tempArray[n]
if(stringTemp.indexOf("Exposure Time")!=-1){
var expTime = tempArray[n+1];

if(stringTemp.indexOf("Focal Length")!=-1){
var focLength = tempArray[n+1];

var aptNum = tempArray[n+1];

if(stringTemp.indexOf("ISO Speed Ratings")!=-1){
var ISONum = tempArray[n+1];

Use this to note the lens use.
Basically, just calculate the 35mm equi of the lens and plug in the figure.
Or simply look at the EXIF info from PS CS
For zoom, just use a range.

if(focLength> =18 && focLength
var Lens = "Nikkor 12-24mm 1:4";
var Lens = "Nikkor 28mm 1:2.0";
var Lens = "Micro-Nikkor 55mm 1:3.5";
var Lens = "Noct-Nikkor 58mm 1:1.2";
var Lens = "Nikkor 85mm 1:1.4";
var Lens = "UV-Nikkor 105mm 1:1.4.5";
var Lens = "Macro-Nikkor 65mm 1:4.5";

if(stringTemp.indexOf("Date Time Original")!=-1){
var phoTime = tempArray[n+1];
var dateArray1 = phoTime.split(" ", 1);
phoTime = dateArray1[0];
var dateArray2 = phoTime.split(":");
var monthsArray =["January",
phoTime = monthsArray[dateArray2[1]-1]+" "+dateArray2[2]+" "+dateArray2[0];

var cameraModel = tempArray[n+1];

change the name here!!!

var nameLayer = AD.artLayers.add();
nameLayer.kind = LayerKind.TEXT;
var TI = nameLayer.textItem;
TI.position = [5,heightVar+16];
TI.contents = "© Regit Young 2005";
TI.font = "Arial";
TI.size = 14;
TI.color = white;
TI.fauxBold = true;

var infoLayer = AD.artLayers.add();
infoLayer.kind = LayerKind.TEXT;
var TI = infoLayer.textItem;
TI.position = [5,heightVar+30];

TI.contents = cameraModel+" with "+Lens+" @ "+focLength+"mm (35mm equiv), "+expTime+", "+aptNum+", ISO: "+ISONum+"\u000DDate photo taken: "+phoTime;
TI.font = "Arial";
TI.size = 11;
TI.color = white;


-- hide signature --

Regit Young
FCAS Member, PBase Supporter

Flat view
Post (hide subjects) Posted by
Keyboard shortcuts:
FForum PPrevious NNext WNext unread UUpvote SSubscribe RReply QQuote BBookmark MMy threads
Color scheme? Blue / Yellow