Photoshop Script for Border (with Exif data)

Status
Not open for further replies.
I can find the 'script' folder to stick it in, but I can't find an option to run/use it in PSE6. The only other file in the script folder is a *.jsx and not a *.js file, if that means anything to anyone!?:shrug:

PS6 & PS7 dont appear to have the SCRIPT command to run it. Shame as it looks like a great little action.:(
 
Excellent :D
Thanks so much!

Glad I could help.

MattyH should have new version up on his website before long and I will update the link on the first post.

In addition, we are going to add a second file. The first will have the added focal length and the second will have the focal length AND the date the picture was taken.
 
Excellent! I will update the first post.
 
Hi again Preacher, been working fine for me on cs3, has encouraged me to tinker with the code, not really done java before, anyway, can now change border/stoke colours to any other colour, plus managed to alter script to resize image/stroke/border to any size, I'm quite pleased with myself really :)

IMG_2712.jpg
 
Excellent!

Glad to see folks are stretching a little, pushing the boundries.

If anyone develops a good variation, post it here and let us know! That is how this thing has grown all along and you never know when YOUR variation might just become the Next Big Thing!
 
Last one, this is quite fun, what do you think of this, little powershot 720 IS hand held 1/6 s, all for just £109 delivered :)

IMG_01642.jpg
 
I think I may have found a tiny flaw in the script... It doesn't appear to recognise ISO 100 from the D300's exif.. .Says ISO:undefined.

It works at other ISO's on the same camera though

I wonder if there is something about the way the data around ISO100 from that camera is reported? Without being able to compare the data from one camera to another, I don't know how to find out.

I know I have run in to the issue if I attempt to use the script on a second generation save.

In other words, I can use it on a raw, a raw conversion to Jpeg, a Jpeg from the camera, but not always on a Jpeg that was "saved As" something else and re-opened.
 
Last one, this is quite fun, what do you think of this, little powershot 720 IS hand held 1/6 s, all for just £109 delivered :)

IMG_01642.jpg

Not bad for a cheap P&S!

Did you add the event name manually to the pic, or the script or....?
 
I wonder if there is something about the way the data around ISO100 from that camera is reported? Without being able to compare the data from one camera to another, I don't know how to find out.

I know I have run in to the issue if I attempt to use the script on a second generation save.

In other words, I can use it on a raw, a raw conversion to Jpeg, a Jpeg from the camera, but not always on a Jpeg that was "saved As" something else and re-opened.

I've just had a bit more look at it... I think you're right, it's the way it's reported... Meh, I'll just use ISO 200 in future :D
 
I've just had a bit more look at it... I think you're right, it's the way it's reported... Meh, I'll just use ISO 200 in future :D

That's the spirit! Adapt, Improvise, Overcome!
 
Does the border get added to the outside of the picture or to the inside (therefore removing part of the pic) I ask because I'm using Resizer script at the mo and it puts the border on the inside.

If its on the outside you might just have saved me days and days worth of work

Oh Is there a way to add the filename?
 
I can change the colours and stroke/border size, but I can't get the text font to change. Can anyone give me a tip on how to do this. I tried changing Tl.font variable but nothing happens :thinking:
 
Does the border get added to the outside of the picture or to the inside (therefore removing part of the pic) I ask because I'm using Resizer script at the mo and it puts the border on the inside.

If its on the outside you might just have saved me days and days worth of work

Oh Is there a way to add the filename?

It adds it to the OUTSIDE of the picture. It doesn't alter the picture other than to resize it for the web.

In fact, as it is set up, it resizes it to 800px wide including the border.

As for adding the file name, I don't know. I'll mess with it and see if I can figure out how to do it.
 
I can change the colours and stroke/border size, but I can't get the text font to change. Can anyone give me a tip on how to do this. I tried changing Tl.font variable but nothing happens :thinking:

Let me see what I can do.

[EDIT]

You can change the font, but only to an *.otf (OpenType) font. The *.ttf (TrueType) fonts won't won't work for some reason.

For example, I changed it to read ACaslonPro-Bold and then changed it to AdobeMyungjoStd-Medium (both *.otf) and they worked, but none of the *.ttf fonts worked.

Why? No idea.

Keep in mind that the font file name needs to be EXACTLY how the file name reads, minus the file extension. Same caps, spaces, dashes, spelling, everything!
 
OK.... I admit it, I rock (at stealing code)

I found a bit of code that does something similar to what was requested and was able to adapt it to this script.

Adding the Name to the picture? No problem! The new script adds the name to the upper, left-hand corner, exactly like the Exif and copyright info.


When MattH has time, he will be able to update the directory he has the scripts stored with the two new versions.

The first is the standard V3 script with Focal Length,
The second is the same script with the date function added.

Here is a sample (Also a sample of the text-change ability)

Cool_Velocity_Stack.jpg


FYI: If you really want the file extension to show (IE: Cool_Velocity_Stack.jpg) then there is a switch you can change from N to Y inside the code. Finding it is up to you :) :)
 
Works a treat, thanks to you both......:thumbs:

Roedeerborder.jpg
 
I've just downloaded these scripts
excellent work chaps - they went straight into cs3 and did what it says on the tin! :thumbs::clap::thumbs:
 
I have worked out how to get more exif data from photoshop but cant work out how to put it in the top part of the border as I've no real idea on JavaScript.

What I'd like to do is use the image description as my title instead of the file name
 
I've added some code to allow layer styles to be created also - if its OK with Preacher i'll post the code. The aperture shows undefined in the first one as i was using tubes.

hopper2.jpg


rd5.jpg
 
Oooo, I didn't know there was a separate thread regarding this. I too have been playing since the original script popped up in another thread. Looks like everyone is pretty much sorted now with it, but I have managed to make some alterations myself... this is mine.

IMG_1927.jpg


Regarding websites and code help. I just downloaded the cs3 scripting manual from adobe website here (acrobat pdf file).
 
thanks for the link:clap:
downloaded and poring over it already!:thumbs:
 
If you did a full install with CS3 you'll find 4 scripting guides at

C:\Program Files\Adobe\Adobe Photoshop CS3\Scripting Guide

assuming you didn't change any of the paths
 
If you did a full install with CS3 you'll find 4 scripting guides at

C:\Program Files\Adobe\Adobe Photoshop CS3\Scripting Guide

assuming you didn't change any of the paths

d'oh :bonk:
 
Oooo, I didn't know there was a separate thread regarding this. I too have been playing since the original script popped up in another thread. Looks like everyone is pretty much sorted now with it, but I have managed to make some alterations myself... this is mine.

<snip>

Regarding websites and code help. I just downloaded the cs3 scripting manual from adobe website here (acrobat pdf file).

Would you be kind enough to send me your script, it's very nice and I can guess a few people might want it :D if you are kind enough, could you PM me and I'll return with my email addy, so I can upload it to my webspace

Cheers :D
 
I've added some code to allow layer styles to be created also - if its OK with Preacher i'll post the code. The aperture shows undefined in the first one as i was using tubes.

hopper2.jpg


rd5.jpg

Great work! Send it to MattyH for upload to his site or email it to me!

I was thinking that this whole thing would be more useful if I could get it to put the info on a new layer, just so I could do things like that.

:thumbs:
 
It's a little messy in places and needs tidying up, but here ya go.

// Add Image Data around the boarder of the image
// Photoshop CS Script


// 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 variables (can add new colours here too)

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 AD = app.activeDocument;



// Execute functions

FlickrBorder();
AuthorText(getPhotoDate());
ImageDataText(getExifData());
AD.flatten();


// Function to add hairline and border for uploading to Flickr

function FlickrBorder() **
AD.flatten();
backgroundColor = black;
AD.selection.selectAll();
AD.selection.stroke(white, 1, StrokeLocation.INSIDE);
AD.resizeCanvas(AD.width.value + 50, AD.height.value + 50, AnchorPosition.MIDDLECENTER);
AD.resizeCanvas(AD.width.value + 0, AD.height.value + 50, AnchorPosition.TOPCENTER);
**



// This function sets Author and copyright notice to image
function AuthorText(strDate) **
var nameLayer = AD.artLayers.add();
nameLayer.kind = LayerKind.TEXT;
var TI = nameLayer.textItem;
TI.position = [23, AD.height.value - 21];
TI.contents = strDate;
TI.font = "ADD FONT NAME HERE";
TI.size = 18;
TI.color = white;
**

// Sets Image info text to image
function ImageDataText(strExif) **
var infoLayer = AD.artLayers.add();
infoLayer.kind = LayerKind.TEXT;
var TI = infoLayer.textItem;
TI.position = [23, AD.height.value - 43];
TI.contents = strExif;
TI.font = "ADD FONT NAME HERE";
TI.size = 18;
TI.color = white;
**


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

var exifData = AD.info.exif.toString();
var exifDataArray = explodeArray(exifData,",");

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("F-Stop")!=-1)**
var fstop = exifDataArray[n+1];
**

if(stringTemp.indexOf("Focal Length")!=-1)**
var focal = exifDataArray[n+1];
**

if(stringTemp.indexOf("ISO Speed Ratings")!=-1)**
var iso = exifDataArray[n+1];
**

**
var strTemp = "Focal Length: " + focal + ", Exposure: " + expTime + " " + fstop + ", ISO: " + iso + ".";

return strTemp;
**




function getPhotoDate() **

var exifData = AD.info.exif.toString();
var exifDataArray = explodeArray(exifData,",");

for(n = 0; n < exifDataArray.length; n = n + 1 ) **

var stringTemp=exifDataArray[n]

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];
**

**

var strTemp = "Copyright © 68lbs_on_Flickr, " + phoTime + ".";

return strTemp;
**




//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;
**
 
just a small note

I see you save the current app settings on the way in
er, but don't restore them on the way out!

probably need to add

app.preferences.rulerUnits = defaultRulerUnits;

in there somewhere after the call to

AD.flatten();
 
Status
Not open for further replies.
Back
Top