keep all metadata in a script that resizes pictures. I want to keep "GPS, Camera etc..data"
Thank you in advance.
I have a script that resizes images, it works perfectly, but it doesnt transfer or copy the metadata of each file resized.
I need to keep the metadata that the file has. please help. here is the script that i have.
// Resize based on height. otherwise, resize based on width
doc = app.activeDocument;
// change the color mode to RGB. Important for resizing GIFs with indexed colors, to get better results
doc.changeMode(ChangeMode.RGB);
// these are our values for the end result width and height (in pixels) of our image
var fWidth = 1920;
var fHeight = 1080;
// do the resizing. if height > width (portrait-mode) resize based on height. otherwise, resize based on width
if (doc.height > doc.width) {
doc.resizeImage(null,UnitValue(fHeight,"px"),null,ResampleMethod.BICUBIC);
}
else {
doc.resizeImage(UnitValue(fWidth,"px"),null,null,ResampleMethod.BICUBIC);
}
// our web export options
var options = new ExportOptionsSaveForWeb();
options.quality = 75;
options.format = SaveDocumentType.JPEG;
options.optimized = true;
var doc = activeDocument;
var f = new Folder(doc.path+'/New folder');
if (!f.exists) {
f.create();
}
// var newName = 'Web.'+doc.name+'.jpg';
var newName = doc.name;
doc.exportDocument(File(doc.path+'/New folder/'+newName),ExportType.SAVEFORWEB,options);// /
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
