function main(){
displayDialogs = DialogModes.NO;
var myFile=null;
while (myFile == null){
myFile =File.openDialog("Select File To Open", "*");
}
open(myFile);
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
activeDocument.resizeImage(800, undefined, undefined, ResampleMethod.BICUBICSHARPER);
var Black = new SolidColor;
Black.rgb.hexValue='000000'
var White = new SolidColor;
White.rgb.hexValue='ffffff'
app.backgroundColor = Black;
var Width = activeDocument.width;
var Height = activeDocument.height;
app.activeDocument.resizeCanvas(Width , Height+30, AnchorPosition.MIDDLECENTER);
var exifData = activeDocument.info.exif.toString().split(",");
for(var a= 0; a < exifData.length; a++ ) {
if(exifData[a]=="Model"){
var Model = exifData[a+1];
}
if(exifData[a]=="Focal Length"){
var Zoom = exifData[a+1];
var Zoom = Zoom.replace(".0 mm", "mm");
}
if(exifData[a]=="ISO Speed Ratings"){
var ISO = exifData[a+1];
}
if(exifData[a]=="Exposure Time"){
var Shutter = exifData[a+1];
var Shutter = Shutter.replace(".0", "");
}
if(exifData[a]=="F-Stop"){
var Aperture = exifData[a+1];
var Aperture = Aperture.replace(".0", "");
}
}
activeDocument.resizeImage(Width, undefined, 72, ResampleMethod.BICUBICSHARPER);
var newTextLayer2 = activeDocument.artLayers.add();
newTextLayer2.kind = LayerKind.TEXT;
newTextLayer2.textItem.kind = TextType.POINTTEXT;
newTextLayer2.textItem.color = White;
newTextLayer2.textItem.font = "Verdana";
newTextLayer2.textItem.size = 9;
newTextLayer2.textItem.contents = "ISO: " + ISO + " Exposure: " + Shutter + " Aperture: " + Aperture + " Zoom: " + Zoom;
activeDocument.selection.selectAll();
align("AdLf");
align("AdTp");
activeDocument.activeLayer.translate(5,3);
app.activeDocument.selection.deselect();
app.preferences.rulerUnits = startRulerUnits;
////Change filename to suit!
placeFile("c:/folderName/folderName/fileName.png");
activeDocument.selection.selectAll();
align("AdRg");
align("AdBt");
activeDocument.activeLayer.translate(-5,-5);
app.activeDocument.selection.deselect();
activeDocument.flatten();
}
main();
function placeFile(placeFile) {
function cTID(s) { return app.charIDToTypeID(s); };
var desc21 = new ActionDescriptor();
desc21.putPath( cTID('null'), new File(placeFile) );
desc21.putEnumerated( cTID('FTcs'), cTID('QCSt'), cTID('Qcsa') );
var desc22 = new ActionDescriptor();
desc22.putUnitDouble( cTID('Hrzn'), cTID('#Pxl'), 0.000000 );
desc22.putUnitDouble( cTID('Vrtc'), cTID('#Pxl'), 0.000000 );
desc21.putObject( cTID('Ofst'), cTID('Ofst'), desc22 );
executeAction( cTID('Plc '), desc21, DialogModes.NO );
};
function align(method) {
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
desc.putReference( charIDToTypeID( "null" ), ref );
desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) );
executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO );
};