EXIF via Copy & Paste

Messages
1,730
Edit My Images
Yes
I have a template in Photoshop with my details on it. I normally open the template and then open the CR2 (RAW) file. I customize the image a bit, and then click 'Open Image'

Once it's open, I select all (CTRL + A), copy (CTRL + C) and then move to the template and paste the image in (CTRL + V). I then transform the image (CTRL + T) so I can get it aligned properly and so on.

The only problem is, by doing this I loose the EXIF data.

I've made a Photoshop script that gets the EXIF data and writes it nearly on the image. It works perfectly, but I can't get the data in the new document.

Can anyone think of a way how I can open the document within another document, in an attempt to keep the EXIF?

I've got everything setup perfectly except the final step. I was thinking of dragging the layer to the new document, but this doesn't work either.

Any ideas?
 
Make sure you do not have any other documents open!
Open your template and select the background layer
Now open your second document
Run the script.
The script will get the resolution and width of the template
Resize the second document to the width of the template
Get the Exif info
Copy
Close the second document
Paste the second document into the template and add the Exif info.
Code:
activeDocument = documents[0];
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var res = activeDocument.resolution;
var Width = activeDocument.width;
activeDocument = documents[1];
var exifData = activeDocument.info.exif.toString().split(","); 
for(var a= 0; a < exifData.length; a++ ) {  
	if(exifData[a]=="ISO Speed Ratings"){ 
	var ISO = exifData[a+1]; 
	} 
	if(exifData[a]=="Exposure Time"){ 
	var Shutter = exifData[a+1];
	}
	if(exifData[a]=="F-Stop"){ 
	var Aperture = exifData[a+1];
	}
}
activeDocument.resizeImage(Width, undefined, res, ResampleMethod.BICUBICSHARPER);
activeDocument.selection.selectAll();
activeDocument.selection.copy();
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
activeDocument = documents[0];
activeDocument.paste();
for(var a =0 ;a<activeDocument.artLayers.length;a++){
	activeDocument.activeLayer = activeDocument.artLayers.getByName(activeDocument.artLayers[a].name);
	if(activeDocument.activeLayer.kind == LayerKind.TEXT){
		activeDocument.activeLayer.textItem.contents = "ISO: " + ISO + " - Shutter: " + Shutter + " - Aperture: " + Aperture;
		}
}
app.preferences.rulerUnits = startRulerUnits;
 
What's with the exclamation mark icon against all of your threads? It gives the impression that you require urgent help with something.... which you don't :shrug:
 
What's with the exclamation mark icon against all of your threads? It gives the impression that you require urgent help with something.... which you don't :shrug:

Ennit V. I hear you on that.

The warning symbol is just that, a 'I need help urgently' or 'Watch out for....' kinda deal.

Quit using it dude, it isn't doing you any favours.

Anyway, by 'template' do you mean your watermark and all that jazz?

If so, you'd be better off having it as a separate layer and dragging it from a master file onto the image your editing, (hold down shift while you drag to keep it centered). You can even save this as an action and make life very simple.
 
Back
Top