|
|
|
@ -29,12 +29,12 @@ var site_names = csv_data.toString().split(",")
|
|
|
|
|
// Retrieve images parent directory from CoastSnap_Sites.csv
|
|
|
|
|
var parent_folder_path = File(site_names[9]);
|
|
|
|
|
|
|
|
|
|
var batch_images_to_register = []; // Used in exportLayersToPNG
|
|
|
|
|
var batch_images_to_register = []; // Used in exportLayersToJPEG
|
|
|
|
|
|
|
|
|
|
// Loop through sites
|
|
|
|
|
for(var i=5; i<site_names.length; i+=5) {
|
|
|
|
|
var site_name = site_names[i];
|
|
|
|
|
var site_path = parent_folder_path + "/" + site_name;
|
|
|
|
|
var site_path = parent_folder_path + "/Images/" + site_name;
|
|
|
|
|
|
|
|
|
|
// Retrieve target and seed images for the site
|
|
|
|
|
var target_folder = new Folder(site_path + '/Target Image');
|
|
|
|
@ -97,7 +97,7 @@ function batch_register_images(batchIndex, site_path, site_name, images_to_regis
|
|
|
|
|
var target_height = target_size[1];
|
|
|
|
|
|
|
|
|
|
savePhotoshopDocument(site_path, site_name);
|
|
|
|
|
exportLayersToPNG(target_width, target_height, batch_images_to_register, seed_images); // Won't overwrite images that already exist
|
|
|
|
|
exportLayersToJPEG(target_width, target_height, batch_images_to_register, seed_images); // Won't overwrite images that already exist
|
|
|
|
|
|
|
|
|
|
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES)
|
|
|
|
|
}
|
|
|
|
@ -233,7 +233,7 @@ function savePhotoshopDocument(site_path, site_name) {
|
|
|
|
|
// EXPORT LAYERS TO IMAGES
|
|
|
|
|
|
|
|
|
|
// $.evalFile(File(app.path + '/Presets/Scripts/Export Layers To Files.jsx'));
|
|
|
|
|
function exportLayersToPNG(target_width, target_height, batch_images_to_register, seed_images){
|
|
|
|
|
function exportLayersToJPEG(target_width, target_height, batch_images_to_register, seed_images){
|
|
|
|
|
if(!documents.length) return;
|
|
|
|
|
var doc = activeDocument;
|
|
|
|
|
var oldPath = activeDocument.path;
|
|
|
|
@ -317,7 +317,7 @@ function exportLayersToPNG(target_width, target_height, batch_images_to_register
|
|
|
|
|
}
|
|
|
|
|
//activeDocument.trim(TrimType.TRANSPARENT,true,true,true,true);
|
|
|
|
|
var saveFile = File(path +"/Photoshop/"+year+"/"+lname);
|
|
|
|
|
SavePNG(saveFile);
|
|
|
|
|
SaveJPEG(saveFile);
|
|
|
|
|
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -334,7 +334,7 @@ function dupLayers() {
|
|
|
|
|
executeAction( charIDToTypeID('Mk '), desc143, DialogModes.NO );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function SavePNG(saveFile){
|
|
|
|
|
function SaveJPEG(saveFile){
|
|
|
|
|
var pngOpts = new ExportOptionsSaveForWeb;
|
|
|
|
|
pngOpts.format = SaveDocumentType.JPEG;
|
|
|
|
|
pngOpts.PNG8 = false;
|
|
|
|
|