Updated README.md

master
Jonathan Chan 2 years ago
parent 161ce79ccd
commit 9d65a51e89

@ -0,0 +1,11 @@
GOTO comment
The following command runs the photoshop javascript file "photoshop_registration_all_sites.jsx" that is in this directory.
You may need to change the photoshop version (year) in the command below to your version
E.g. "\Adobe Photoshop 2022\" may need to be "\Adobe Photoshop 2021\"
:comment
"C:\Program Files\Adobe\Adobe Photoshop 2022\Photoshop.exe" -r "%~dp0photoshop_registration_all_sites.jsx"

@ -0,0 +1,3 @@
call activate coastsnap
python "%~dp0spotteron_batch_download.py"
call conda deactivate

@ -0,0 +1,3 @@
call activate coastsnap
python "%~dp0tag_registered.py"
call conda deactivate

@ -1 +0,0 @@
"C:\Program Files\Adobe\Adobe Photoshop 2022\Photoshop.exe" -r "C:\Users\z5079346\OneDrive - UNSW\Projects\Coastsnap\coastsnap\photoshop_registration_all_sites.jsx"

@ -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;

@ -31,7 +31,7 @@ var parent_folder_path = File(site_names[9]);
var batch_images_to_register = []; // Used in exportLayersToPNG
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');

@ -1,3 +0,0 @@
call activate coastsnap
python "C:\Users\z5079346\OneDrive - UNSW\Projects\Coastsnap\coastsnap\spotteron_batch_download.py"
call conda deactivate
Loading…
Cancel
Save