Photoshop Script for Border (with Exif data)

Status
Not open for further replies.
I aint getting that lens detials in mine....

Could you post me a edited file that will do this..

See #153 or any other post I have included the ZIP link on!

Check your file for the entry EXlens in the list, if you do not have this then you are on an older version.
 
PM me your email and will send a shot I have just tesded on, not the best picture but I'm sure you understand why.

I aint getting that lens detials in mine....

Could you post me a edited file that will do this..

In fact send me the file your using as I love your white boarder I know where to alter the copyright name
 
I have now created the worlds quickest web site !

CLICK HERE

This is in order to put all the information in one place. I will add some examples of script changes and what they produce as and when people let me know what they like.
 
alright ive downloaded this .. i think to the right place..

now in ps7 how / where do i find the script..:shrug:


md:shrug:
 
alright ive downloaded this .. i think to the right place..

now in ps7 how / where do i find the script.

Where did you download it to?

If you don't know right click your icon, and "Save link as" then it will show your preferred destination for files. HTH
 
Where did you download it to?

If you don't know right click your icon, and "Save link as" then it will show your preferred destination for files. HTH

:shrug:

might sound thick prob will but what icon..

md:shrug:
 
alright ive downloaded this .. i think to the right place..

now in ps7 how / where do i find the script..:shrug:


md:shrug:

I find it best to download it to the desktop as a zip file and then open the zip file. If you look up a few posts click on the very large "Click Here" and it describes what to do with this file.

HOWEVER ..... PS7! How old is that? I am not sure if it will work with that version which is about 4-5 versions of PS ago. Let me know if it does.
 
righto what i mean is iv'e done my picture .. tweaked it a little now its fantastic...:nuts:


where do i find the script to do the border and resize...

do i have to open something else is it hidden behind something


doe's this make sense.


bear in mind i am a pc knob


md(y)
 
I have now created the worlds quickest web site !

CLICK HERE

This is in order to put all the information in one place. I will add some examples of script changes and what they produce as and when people let me know what they like.

Well done Darren, you have been working really hard. I now get my lens to display but it still gives the focal length as 35mm equivalent value. Can someone else please test it to see if they have the same problem. Is it just a problem with Nikon owners or is it the same for Canon owners as well.:thinking: I've been working on the script for ages now but can't seem to find the solution. It's amazing how much programming you can forget when you haven't done it for a while.:bang:
 
righto what i mean is iv'e done my picture .. tweaked it a little now its fantastic...:nuts:


where do i find the script to do the border and resize...

do i have to open something else is it hidden behind something


doe's this make sense.


bear in mind i am a pc knob


md(y)

Click File>Script and it should be in there if you have put the file in the right place! Just check the info site.
 
:LOL:

everything i have is old..


pc..
lenses
camera
wife :naughty:


if it dont work not a problem i'll carry on not doing it......



md:wave:
 
Well done Darren, you have been working really hard. I now get my lens to display but it still gives the focal length as 35mm equivalent value. Can someone else please test it to see if they have the same problem. Is it just a problem with Nikon owners or is it the same for Canon owners as well.:thinking: I've been working on the script for ages now but can't seem to find the solution. It's amazing how much programming you can forget when you haven't done it for a while.:bang:

Thanks. I would just forget the 35mm equivalent thing for now and i'll have a look at it again, I think I need a few more inputs from other people. The script just reads the data from the EXIF record so whatever is in there is it!

As for the programming I haven't had the need to use javascript before but most high level languages are pretty similar. Biggest problem is syntax and I've had to work that out from other bits of the script.

Well I managed it so it wasn't that bad :)
 
:shrug:



na .. nowt ... nil .... diddle squat..


must be me..:bang:


md:thumbsdown:
 
Thanks. I would just forget the 35mm equivalent thing for now and i'll have a look at it again, I think I need a few more inputs from other people. The script just reads the data from the EXIF record so whatever is in there is it!

As for the programming I haven't had the need to use javascript before but most high level languages are pretty similar. Biggest problem is syntax and I've had to work that out from other bits of the script.

Well I managed it so it wasn't that bad :)

I've just removed the focal length for now and just left the lens info in. It works for me in RAW or jpg. After all the messing about with the script tonight I now remember why I gave up programming for a job. I must get to grips with javascript now though as its bugging me.

The EXIF record in my file gives the correct focal length, so I just don't know what's going on. :bang: It's not going to get the better of me.:bonk:

Thanks for all your effort, and making me think about scripting. I forgot it even existed in Photoshop.(y)
 
:LOL:

everything i have is old..


pc..
lenses
camera
wife :naughty:


if it dont work not a problem i'll carry on not doing it......



md:wave:

You can also go to File, Scripts, Browse and navigate down to where you usually put your downloads, and then highlight downloaded file, and chose Load. It will then run automatically. don't forget to open your picture first though. If you cant remember where you put it, just download it again.
 
UPDATE: Modification made to routine to display lens data. Now treats the return value of "0.0 mm f0.0" (non CPU data lens on D200+ Nikons) as being unavailable and stops it being displayed.


To go to the script file site:

CLICK HERE

OR

JUST DOWNLOAD ZIP FILE
 
UPDATE: Changes to the lens data section...

Added two variables in relation to non CPU lens and added a lookup table to add your own lenses so that it displays the lenses full name.

// I HAVE ONE non CPU lens !!!

var LENSnoncpuone = true;
var LENSname = "Nikon AI-S 85mm f2.0";


If you have a camera such as the D200 and a non CPU lens such as the one shown above then it will be displayed in the EXIF data as "0.0 mm f0.0" which isn't very helpful. If you only have one non CPU lens then it is the only one which will return this value and if this is the case then change the value of LENSnoncpuone to true and enter the name of your lens in the variable LENSname. It will now correct the name of your lens.



// Lens conversion LENSexif is returned value, LENSshow is value to be substituted.

LENSexif = new Array(10); //Do not change this line unless you own more than 10 lenses
LENSshow = new Array(10); //Do not change this line unless you own more than 10 lenses

LENSexif[1] = "18.0-200.0 mm f/3.5-5.6";
LENSshow[1] = "Nikon AF-S 18-200mm f/3.5-5.6 VR2 DX ED IF";
LENSexif[2] = "50.0 mm f/1.8";
LENSshow[2] = "Nikon AF 50.0 mm f/1.8";
LENSexif[3] = "105.0 mm f/2.8";
LENSshow[3] = "Nikon AF-S 105mm f/2.8 G IF-ED";
LENSexif[4] = "XXX";
LENSshow[4] = "?";
LENSexif[5] = "XXX";
LENSshow[5] = "?";
LENSexif[6] = "XXX";
LENSshow[6] = "?";
LENSexif[7] = "XXX";
LENSshow[7] = "?";
LENSexif[8] = "XXX";
LENSshow[8] = "?";
LENSexif[9] = "XXX";
LENSshow[9] = "?";
LENSexif[10] = "XXX";
LENSshow[10] = "?";

Newer lens will display their name correctly but you may wish to display the lens's "Sunday" name so to speak. If this is the case you can enter their details above. Note the first 2 lines are LENSexif[1] and LENSshow[1] these two lines relate to the first lens so the result returned by the EXIF data goes in the first line and the text you want displayed goes in the second. Just continue this through all the lenses. It is possible to use as many lenses as you like but if you do it will require changing the size of the arrays above from 10 to a larger number and then changing the size of the FOR loop in the actual code. Look for the line " for(n = 1; n<11; n = n + 1 ) **" in Function "GetExifData", you need to change the 11 to 1 more than your chosen value for the arrays.

Hope this helps further, changes added to mini site

To go to the script file site:

CLICK HERE

OR

JUST DOWNLOAD ZIP FILE
 
Hi and BIG thank you for this Script.

But,id like to Not show the file name on the picture as im having a bit of a problem as iv changed the size to 3072-2304 and the boarder width to 50 and file name has drifted onto the picture from the top left corner.

Can this be corrected

If not where abouts can i change the y to n below.



// Defaults relating to display of the filename

var ShowExtension = false; // If you wish to show the file extension, change the n to y in the line below, if not use n.


Cheers Del.
 
Is anyone here using Aperture??? And have you been able to export the version as raw or jpeg to be able to get the Lens detials included? As at the moment I can only export as Tiff which is no good
 
Is anyone here using Aperture??? And have you been able to export the version as raw or jpeg to be able to get the Lens detials included? As at the moment I can only export as Tiff which is no good

I uninstalled Aperture and went to Lightroom because I thought that you had to have all the pictures in the Aperture data directory and mine was getting to 40Gb. I tried Lightroom and VERY MUCH preferred it. I then found that you could keep the data directory as links to your picture (like Lightroom does) but by that time I preferred Lightroom so much that I just bought that!

Are you storing all your pictures within the actual Aperture data directory? If not just go to the actual picture from Finder and open it with Photoshop.

If you are holding all the pictures in the Aperture data directory then right click the directory and 'show contents', you will find your picture in there still as RAW that you can again open with Photoshop.

Lastly there may be an option within Aperture to send the picture to an outside package as RAW, it may not be in the edit with section though.
 
So did anyone get any sleep last night ;) or were they busy scripting.

Not had a chance to try it out yet but it looks good....

Does anyone know the command to call the save routine?

Do you mean from within the script? If so then yes I found that whilst looking for the open routine. I will be writing a batch processor soon where it accepts user input (of a directory) then processes everything inside that directory. I am back at work on nights tonight though so not sure how much I will get done. I did get all the bits done I wanted though and a few extras too :)

Look near the end of the script too, there is a save function left over there!
 
I've just tried
var PictureWidth = 1000;
var PictureHeight = 1000;
var PictureResolution = 150;

and left my copyright the same size as i have for 800 x 800
var TextColour = white; // white, black, red, user_colour_1 OR user_colour_2 (see above)
var TextCopyrightStart = "Copyright \xA9 "; // include \xA9 for copyright symbol
var TextCopyright = "Keltic Rose Services";
var TextBold = true;
var TextFont = "CenturyOldStyleStd-Italic";
var TextSize = 12;

and the font for the copyright seems to have got bigger, and is now over the border. Is the textsize done as a percentage of the picture size? or as a true size?

Just wondered if this was now fixed, or was it just me :)
 
:wacky::wacky::wacky::wacky::wacky:

Please help.

I have a new PC and wanted to load the script like on my old machine. I have put it in the correct folder and it works perfectly but here is the problem...........

I want to have a bigger border. Where does it metion the border size in the script?

And thanks for this as it is a super piece of timesaving software.


ps please change the word boarder to border in the script. (or is it boarder, me being dumb again)


Thanks
 
var BoarderColor = black; // white, black, red, user_colour_1 OR user_colour_2 (see above)
var StrokeColor = white; // white, black, red, user_colour_1 OR user_colour_2 (see above)
var BoarderWidth = 50; Change boarder size here
var StrokeWidth = 3;
 
var BoarderColor = black; // white, black, red, user_colour_1 OR user_colour_2 (see above)
var StrokeColor = white; // white, black, red, user_colour_1 OR user_colour_2 (see above)
var BoarderWidth = 50; Change boarder size here
var StrokeWidth = 3;


I tried to add the last 2 lines without the red words and it returned an error.
 
No mate thats already in the script,all i did was change the 50 to the size i was after.
 
In red..




// First thing is to set up what setting will be used in the rest of the script
// but save them so they can be reset to what they were before this script is ran.
displayDialogs = DialogModes.NO;
var defaultRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;



// Define 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 red = new SolidColor();
red.rgb.red = 255;
red.rgb.green = red.rgb.blue = 0;


var landscape = false; // just in case its square !
var TextLine = "";




///
/// User default presets
///
///

var complete_flatten = false; // Set this to true and all layers will be flattened at the end

// User colour values

var user_colour_1 = new SolidColor();
user_colour_1.rgb.red = 200;
user_colour_1.rgb.green = 100;
user_colour_1.rgb.blue = 100;

var user_colour_2 = new SolidColor();
user_colour_2.rgb.red = 100;
user_colour_2.rgb.green = 200;
user_colour_2.rgb.blue = 100;


// Picture size

var PictureWidth = 3072;
var PictureHeight = 2304;
var PictureResolution = 72;


// Boarder defaults

var BoarderColor = black; // white, black, red, user_colour_1 OR user_colour_2 (see above)
var StrokeColor = white; // white, black, red, user_colour_1 OR user_colour_2 (see above)
var BoarderWidth = 50;
var StrokeWidth = 3;


// Additional text defaults

var TextColour = white; // white, black, red, user_colour_1 OR user_colour_2 (see above)
var TextCopyrightStart = "Copyright \xA9 "; // include \xA9 for copyright symbol
var TextCopyright = "xxxxx.";
var TextBold = true;
var TextFont = "CenturyOldStyleStd-Italic";
var TextSize = 15;


// Show information ?

var DisplayTop = true;
var DisplayLeft = true;
var DisplayRight = true;
var DisplayBottom = true;


// Defaults regarding year displayed in copyright notice

var UseExifYear = true;
var TextCopyrightYear = "2008"; // When UseExifYear is false (c) year is set to this....


// Defaults relating to display of the filename

var ShowExtension = false; // If you wish to show the file extension, change the n to y in the line below, if not use n.
var TextBefore = ""; // Text displayed before filename on top line
var TextAfter = ""; // Text displayed after filename on top line


// Exif data to display

var EXblanklinefornonexif = true; // If true then non exif pictures will have blank line otherwise it will add "non EXIF data"

var EXcameramodel = true;
var EXfstop = true;
var EXfocal = true;
var EXshutterspeed = true;
var EXiso = true;
var EXlens = true;

var EXexposurebiasvalue = false;
var EXfilmeq = false;
var EXgaincontrol = false;
var EXmeteringmode = false;
var EXlightsource = false;
var EXphotime =false;
var EXwhitebalance = false;
var EXaperturevalue = false;
var EXexptime = false;
var EXmaxaperturevalue = false;
var EXflash = false;
var EXcolourspace = false;
var EXsensingmethod = false;
var EXexposuremode = false;


// Displaying copyright TEXT

var DisplayCopyrightText = false;
var CT_Text = "This image is \xA9 xxx"; // include \xA9 for copyright symbol
var CT_X = 50; // Percentage
var CT_Y = 50; // Percentage
var CT_Angle = 65;
var CT_Colour = user_colour_2; // white, black, red, user_colour_1 OR user_colour_2 (see above)
var CT_Transparency = 50;
var CT_Bold = true;
var CT_Size = 20;
var CT_Font = "CenturyOldStyleStd";

// Displaying copyright IMAGE

var DisplayCopyrightImage = false;
var IM_Name = "~/Documents/Signature.png";
var IM_X = 10; // Percentage
var IM_Y = 10; // Percentage
var IM_percentage = 20; // Height as a Percentage
var IM_Transparency = 100;


// =========================================================================================================================
//
// This is the main part of the script........
//
// =========================================================================================================================
//


var AD = app.activeDocument;

PrepImage();


AD.flatten(); //This puts all the layers back together

// Now each of the bits of text will be another layer
// if you do not want them as seperate layers you can move the AD.flatten(); command to below the 4 if commands


if (DisplayLeft) {ImageDataTextLeft(getExifDate()) **;
if (DisplayRight) {ImageDataTextRight(TextCopyrightStart+getExifYear()+" "+TextCopyright) **;
if (DisplayBottom) {ImageDataTextBottom(getExifData()) **;
if (DisplayTop) {ImageDataTextTop() **;

if (DisplayCopyrightText){addcopyrighttext() **;
if (DisplayCopyrightImage){addcopyrightimage() **;

if (complete_flatten){AD.flatten();**;


// =========================================================================================================================
//
// This is the main part of the script........
//
// =========================================================================================================================
//


function addcopyrightimage() **

var signature_file,filename

//alert("Copyright Image: Give me a chance !!!!!");

var docRef = activeDocument;

filename = new File(File.encode(IM_Name));
// filename = File.openDialog("Select file");


// alert(filename);


if(typeof filename.open == "undefined") {alert("Signature file [" + IM_Name +"] is not a file or doesn't exist")**;

signature_file = open( filename );

var orig_ruler_units = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;

// make signature file the active document

app.activeDocument = signature_file;

// resize this

var AD = app.activeDocument;

AD.resizeImage(AD.width.value*IM_percentage/100*PictureWidth/AD.width.value,
AD.height.value*IM_percentage/100*PictureWidth/AD.width.value,
AD.resolution*IM_percentage/100);

var sig_width = AD.width.value;
var sig_height = AD.height.value;

// Copy it and then close the document


signature_file.activeLayer.copy();
signature_file.close(SaveOptions.DONOTSAVECHANGES);

app.activeDocument=docRef;

var myLayerRef = docRef.artLayers.add();
myLayerRef.kind = LayerKind.NORMAL;
myLayerRef.name = "Copyright Image";

var x1 = PictureWidth*IM_X/100;
var x2 = x1 + sig_width;
var y1 = PictureHeight*IM_Y/100;
var y2 = y1 + sig_height;

var IMregion = Array(Array(x1, y1),Array(x2, y1),Array(x2, y2),Array(x1, y2));

docRef.selection.select(IMregion);

docRef.paste() ;

myLayerRef.opacity = IM_Transparency;

app.preferences.rulerUnits = orig_ruler_units;



**

function addcopyrighttext()**

var docRef = activeDocument;
var myLayerRef = docRef.artLayers.add();
myLayerRef.kind = LayerKind.TEXT;
myLayerRef.name = "Copyright Notice";
var myTextRef = myLayerRef.textItem;
myTextRef.size = CT_Size;
myTextRef.font = CT_Font;
myTextRef.color = CT_Colour;
myTextRef.fauxBold = CT_Bold;
myTextRef.position = [ CT_X*PictureWidth/100, CT_Y*PictureHeight/100 ];
myLayerRef.blendMode = BlendMode.NORMAL;
myLayerRef.opacity = CT_Transparency;
myTextRef.contents = CT_Text;
AD.activeLayer.rotate(-CT_Angle,AnchorPosition.BOTTOMLEFT); // rotate the text
**

function PrepImage() **

// Set resolution to 72dpi for monitor viewing
var resRatio = AD.resolution/PictureResolution;

if(resRatio!=1)**
AD.resizeImage(AD.width.value,AD.height.value,PictureResolution);
**

// checking resizeCanvasif landscape and if so, set width to 800 and height to proportionate value

if(AD.width.value>AD.height.value)**
landscape = true;
if(AD.width.value>PictureWidth){AD.resizeImage((PictureWidth-(BoarderWidth+StrokeWidth)), AD.height.value/AD.width.value*(PictureWidth-(BoarderWidth+StrokeWidth))); **
**

// checking if portrait and if so, set width to 800 and height to proportionate value

if(AD.height.value>AD.width.value)**
landscape = false;
if(AD.height.value>PictureHeight){AD.resizeImage(AD.width.value/AD.height.value*(PictureHeight-(BoarderWidth+StrokeWidth)),(PictureHeight-(BoarderWidth+StrokeWidth))); **
**


// Create stoke by increasing the canvas size
backgroundColor = StrokeColor;
AD.resizeCanvas(AD.width+StrokeWidth,AD.height.value+StrokeWidth,AnchorPosition.MIDDLECENTER);
// Create boarder by increasing the canvas size
backgroundColor = BoarderColor;
AD.resizeCanvas(AD.width+BoarderWidth,AD.height.value+BoarderWidth,AnchorPosition.MIDDLECENTER);

**

function ImageDataTextRight(strData) **

var nameLayer = AD.artLayers.add();
nameLayer.kind = LayerKind.TEXT;
var TI = nameLayer.textItem;
TI.position = [AD.width.value - 4, AD.height.value - 25];
TI.contents = strData+" ";
TI.font = TextFont;
TI.size = TextSize;
TI.tracking = 180;
TI.color = TextColour;
TI.fauxBold = TextBold;
AD.activeLayer.rotate(-90,AnchorPosition.BOTTOMLEFT); // rotate the text
**

function ImageDataTextLeft(strData) **

var nameLayer = AD.artLayers.add();
nameLayer.kind = LayerKind.TEXT;
var TI = nameLayer.textItem;
TI.position = [15, AD.height.value - 25];
TI.contents = strData+" ";
TI.font = TextFont;
TI.size = TextSize;
TI.tracking = 180;
TI.color = TextColour;
TI.fauxBold = TextBold;
AD.activeLayer.rotate(-90,AnchorPosition.BOTTOMLEFT); // rotate the text
**

function ImageDataTextBottom(strData) **

//var tmpString = new String(strData);
var infoLayer = AD.artLayers.add();
infoLayer.kind = LayerKind.TEXT;
var TI = infoLayer.textItem;
TI.position = [20, AD.height.value - 5];
TI.contents = strData+" ";
TI.font = TextFont;
TI.size = TextSize;
TI.tracking = 50;
TI.color = TextColour;
TI.fauxBold = TextBold;
**


function ImageDataTextTop(strData) **

//Check if a document is open
if ( documents.length > 0 )
**
var originalRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PERCENT;

try
**
var docRef = activeDocument;

// Create a text layer at the front

var myLayerRef = docRef.artLayers.add();
myLayerRef.kind = LayerKind.TEXT;
myLayerRef.name = "Filename";
var myTextRef = myLayerRef.textItem;

myTextRef.size = TextSize;
myTextRef.font = TextFont;
myTextRef.color = TextColour;
myTextRef.fauxBold = TextBold;

// Set the position of the text - percentages from left first, then from top.
myTextRef.position = new Array( 2, 1.5);
if(landscape) {myTextRef.position = new Array( 2, 2.3);**

// Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
myLayerRef.blendMode = BlendMode.NORMAL;

// select opacity in percentage
myLayerRef.opacity = 100;

// The following code strips the extension and writes tha text layer. fname = file name only

di=(docRef.name).indexOf(".");
fname = (docRef.name).substr(0, di);

//use extension if set
if (ShowExtension) {fname = docRef.name**

myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;


**
catch( e )
**
// An error occurred. Restore ruler units, then propagate the error back
// to the user
preferences.rulerUnits = originalRulerUnits;
throw e;
**

// Everything went Ok. Restore ruler units
preferences.rulerUnits = originalRulerUnits;
**
else {alert( "You must have a document open to add the filename!" ); **

**


// Sets image data to a string that will later be used to set into the image
function getExifData() **

// Get exif data from file
var exifData = AD.info.exif.toString();

// Use this function to put string into array.
// Returns tempArray
var exifDataArray = explodeArray(exifData,",");

if(exifData == "")**
if(EXblanklinefornonexif){return " ";**else{return "Non EXIF data";**

**else{

// Get the info I want
for(n = 0; n < exifDataArray.length; n = n + 1 ) **

var stringTemp=exifDataArray[n]


// alert(n + ": " + stringTemp); //Show what's coming out of array

if(stringTemp.indexOf("Date Time Original")!=-1)**
var phoTime = exifDataArray[n+1];
var dateArray1 = phoTime.split(" ", 1);
phoTime = dateArray1[0];
var dateArray2 = phoTime.split(":");

var monthsArray =["January","February","March","April","May","June","July","August","September","October","November","December"];
phoTime = monthsArray[dateArray2[1]-1]+" "+dateArray2[2]+" "+dateArray2[0];
**

if(stringTemp.indexOf("Exposure Time")!=-1){var expTime = exifDataArray[n+1]; **
if(stringTemp.indexOf("Model")!=-1){var cameraModel = exifDataArray[n+1]; **
if(stringTemp.indexOf("F-Stop")!=-1){var fstop = exifDataArray[n+1]; **
if(stringTemp.indexOf("Focal Length")!=-1){var focal = exifDataArray[n+1];**
if(stringTemp.indexOf("Shutter Speed")!=-1){var shutterspeed = exifDataArray[n+1];**
if(stringTemp.indexOf("Aperture Value")!=-1){var aperturevalue = exifDataArray[n+1];**
if(stringTemp.indexOf("Exposure Bias Value")!=-1){var exposurebiasvalue = exifDataArray[n+1];**
if(stringTemp.indexOf("Max Aperture Value")!=-1){var maxaperturevalue = exifDataArray[n+1];**
if(stringTemp.indexOf("Metering Mode")!=-1){var meteringmode = exifDataArray[n+1];**
if(stringTemp.indexOf("Light Source")!=-1){var lightsource = exifDataArray[n+1];**
if(stringTemp.indexOf("Flash")!=-1){var flash = exifDataArray[n+1];**
if(stringTemp.indexOf("Color Space")!=-1){var colorspace = exifDataArray[n+1];**
if(stringTemp.indexOf("Sensing Method")!=-1){var sensingmethod = exifDataArray[n+1];**
if(stringTemp.indexOf("Exposure Mode")!=-1){var exposuremode = exifDataArray[n+1];**
if(stringTemp.indexOf("White Balance")!=-1){var whitebalance = exifDataArray[n+1];**
if(stringTemp.indexOf("Gain Control")!=-1){var gaincontrol = exifDataArray[n+1]; **
if(stringTemp.indexOf("ISO Speed Ratings")!=-1){var iso = exifDataArray[n+1]; **
if(stringTemp.indexOf("Focal Length in 35mm Film")!=-1){var filmeq = exifDataArray[n+1]; **

** // End of For loop


// Raw xml data to extract lens info
// Only available on RAW images?
var xmldata = AD.xmpMetadata.rawData;

try **

var pattern = /(.*<aux:Lens>)(.*)(<\/aux:Lens>)/;
var results = xmldata.match(pattern);
if (results)
lens = results[2];
else {lens = "?"; EXlens = false;**

**
catch(err) **
lens = "?"; EXlens = false;
**

if(lens = "0.0 mm f/0.0")EXlens = false;

var strTemp = "";

if(EXcameramodel){strTemp = strTemp + cameraModel + " ";**
if(EXshutterspeed){strTemp = strTemp + shutterspeed + " ";**
if(EXfstop){strTemp = strTemp + fstop + " ";**
if(EXiso){strTemp = strTemp + " ISO:" + iso + " ";**

if(EXlens){strTemp = strTemp + " LENS:" + lens + " ";**

if(EXfocal){strTemp = strTemp + " Focal Length:" + focal + " ";**
if(EXaperturevalue){strTemp = strTemp + " Aperture Value:" + aperturevalue + " ";**
if(EXexposurebiasvalue){strTemp = strTemp + " Exposure Bias Value:"+ exposurebiasvalue + " ";**
if(EXgaincontrol){strTemp = strTemp + " Gain Control:"+ gaincontrol + " ";**
if(EXmaxaperturevalue){strTemp = strTemp + " Max Aperture Value:"+ maxaperturevalue + " ";**
if(EXmeteringmode){strTemp = strTemp + " Metering Mode:"+ meteringmode + " ";**
if(EXfilmeq){strTemp = strTemp + " 35mm Equivakent:"+ filmeq + "mm ";**
if(EXlightsource){strTemp = strTemp + " Lightsource:"+ lightsource + " ";**
if(EXflash){strTemp = strTemp + " Flash:"+ flash + " ";**
if(EXcolourspace){strTemp = strTemp + " Colour Mode:"+ colorspace + " ";**
if(EXsensingmethod){strTemp = strTemp + " Sensing Method:"+ sensingmethod + " ";**
if(EXexposuremode){strTemp = strTemp + " Exposure Mode:"+ exposuremode + " ";**
if(EXwhitebalance){strTemp = strTemp + " White Balance:"+ whitebalance + " ";**
if(EXexptime){strTemp = strTemp + " Exposure Time:" + expTime + " ";**
if(EXphotime){strTemp = strTemp + " Date & Time:" + phoTime + " ";**


return strTemp;
**

**


// Extract date from Exif Data
function getExifDate() **

// Get exif data from file
var exifData = AD.info.exif.toString();

// Use this function to put string into array.
// Returns tempArray
var exifDataArray = explodeArray(exifData,",");

if(exifData == "")**

return " ";

**
else
**


// Get the info I want
for(n = 0; n < exifDataArray.length; n = n + 1 ) **

var stringTemp=exifDataArray[n]
// alert(n + ": " + stringTemp); //Show what's coming out of array
if(stringTemp.indexOf("Exposure Time")!=-1)**
var expTime = exifDataArray[n+1];
**

if(stringTemp.indexOf("Date Time Original")!=-1)**
var phoTime = exifDataArray[n+1];
var dateArray1 = phoTime.split(" ", 1);
phoTime = dateArray1[0];
var dateArray2 = phoTime.split(":");

var monthsArray =["January","February","March","April","May","June","July","August","September","October","November","December"];
phoTime = monthsArray[dateArray2[1]-1]+" "+dateArray2[2]+" "+dateArray2[0];
**


** // End of For loop


var strTemp = phoTime;

return strTemp;
**
**

// Extract year from Exif Data
function getExifYear() **

var exifData = AD.info.exif.toString();
var exifDataArray = explodeArray(exifData,",");
var ExifYear = TextCopyrightYear;
for(n = 0; n < exifDataArray.length; n = n + 1 ) **

var stringTemp=exifDataArray[n]
if(stringTemp.indexOf("Exposure Time")!=-1)**
var expTime = exifDataArray[n+1];
**
if(stringTemp.indexOf("Date Time Original")!=-1)**
var phoTime = exifDataArray[n+1];
var dateArray1 = phoTime.split(" ", 1);
phoTime = dateArray1[0];
var dateArray2 = phoTime.split(":");

if(UseExifYear)**
ExifYear = dateArray2[0];
**
**
** // End of For loop
var strTemp = ExifYear;

return strTemp;

**

function NotBlank(strData) **

if(strData = ""){TextLine=" "**;

**

// Save File
function SaveJPEG(inFileName) **
var jpegOptions = new JPEGSaveOptions();
jpegOptions.quality = 9;
activeDocument.saveAs( File( inFileName ), jpegOptions );
**

//function below credited to 'bradles' over at the Adobe User to User forums.
function explodeArray(item,delimiter) **

tempArray=new Array(1);
var Count=0;
var tempString=new String(item);
while (tempString.indexOf(delimiter)>0) **
tempArray[Count]=tempString.substr(0,tempString.indexOf(delimiter));
tempString=tempString.substr(tempString.indexOf(delimiter)+1,tempString.length-tempString.indexOf(delimiter)+1);
Count=Count+1
**
tempArray[Count]=tempString;
return tempArray;
**
 
this is an older version I have upgraded it since with an enhancement to the lens data section but the changes in relation to one work with others. Sorry can't be more help I am on my iPhone at the moment at work. Look upwards (or in my sig) I have created a mini web site for this script now!
 
I have created a new web site which now incorporates the script file. I will be adding lots of other scripts too over the next few months as I am quite enjoying making them.

 
Well just found a bug where it messes up SQUARE pictures so I have fixed it and it is working again. Anyone who has spent loads of time changing their script it might be easier to fix the bug rather than redo all their changes.

Just replace the PropImage() function.....


function PrepImage() **

// Set resolution to 72dpi for monitor viewing
var resRatio = AD.resolution/PictureResolution;

if(resRatio!=1)**
AD.resizeImage(AD.width.value,AD.height.value,PictureResolution);
**

// checking resizeCanvasif landscape and if so, set width to 800 and height to proportionate value

if(AD.width.value>AD.height.value)**
landscape = true;
if(AD.width.value>PictureWidth){AD.resizeImage((PictureWidth-(BoarderWidth+StrokeWidth)), AD.height.value/AD.width.value*(PictureWidth-(BoarderWidth+StrokeWidth))); **
**else{
landscape = false;
if(AD.height.value>PictureHeight){AD.resizeImage(AD.width.value/AD.height.value*(PictureHeight-(BoarderWidth+StrokeWidth)),(PictureHeight-(BoarderWidth+StrokeWidth))); **
**


// Create stoke by increasing the canvas size
backgroundColor = StrokeColor;
AD.resizeCanvas(AD.width+StrokeWidth,AD.height.value+StrokeWidth,AnchorPosition.MIDDLECENTER);
// Create boarder by increasing the canvas size
backgroundColor = BoarderColor;
AD.resizeCanvas(AD.width+BoarderWidth,AD.height.value+BoarderWidth,AnchorPosition.MIDDLECENTER);

**



 
I have added an 'outerborder' part and renamed boarder as border everywhere!

Having the outer border gives a nice effect like a sandwich.

// Boarder defaults

var StrokeWidth = 3; // 0 = off
var StrokeColor = red; // white, black, red, user_colour_1 OR user_colour_2 (see above)

var BorderWidth = 35; // 0 = off
var BorderColor = black; // white, black, red, user_colour_1 OR user_colour_2 (see above)

var OuterBorderWidth = 0; // 0 = off
var OuterBorderColour = white; // white, black, red, user_colour_1 OR user_colour_2 (see above)


 
I've just tried
var PictureWidth = 1000;
var PictureHeight = 1000;
var PictureResolution = 150;

and left my copyright the same size as i have for 800 x 800
var TextColour = white; // white, black, red, user_colour_1 OR user_colour_2 (see above)
var TextCopyrightStart = "Copyright \xA9 "; // include \xA9 for copyright symbol
var TextCopyright = "Keltic Rose Services";
var TextBold = true;
var TextFont = "CenturyOldStyleStd-Italic";
var TextSize = 12;

and the font for the copyright seems to have got bigger, and is now over the border. Is the textsize done as a percentage of the picture size? or as a true size?

:)

Just wondered if this was now fixed, or was it just me ?
 
Just wondered if this was now fixed, or was it just me ?


I was trying to get everything working at 800x800 first. Although I have made the x size and y size variables I have not, as yet, checked all possibilities.

I know about the text not fitting problem for certain sizes and it IS my next job with it. You can however select that layer and move the text which I know is not really good enough but it will work for now......

I will let you know....


ADDED: Oh and I think the RESOLUTION part might well have been the culprit :)
 
lol - Thanks for taking the time Darren to work on these scripts.

I like the new website :)

I have found the problem! It is being fixed as we speak :)

I now have three web sites to look after :) But I thought that I could do with a site just for my Talk Photography life !!
 
I have found the problem! It is being fixed as we speak :)

I now have three web sites to look after :) But I thought that I could do with a site just for my Talk Photography life !!

Thanks :)

Don't suppose you worked out what the savefile routine in the script needs to call it. Do I need to pass it the filename? (I know its not your code, but i cant make anything of it)
 
Status
Not open for further replies.
Back
Top