From 1c325c12d4fb796152523e2d84a9e6404aa35acb Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 9 Nov 2023 10:40:58 +0100 Subject: [PATCH] check existence of stitched file before running stitching --- hugin-gopro-fusion/exif_batch.sh | 6 +++--- hugin-gopro-fusion/main.ts | 15 +++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/hugin-gopro-fusion/exif_batch.sh b/hugin-gopro-fusion/exif_batch.sh index 430d4fab..5d0e79e5 100755 --- a/hugin-gopro-fusion/exif_batch.sh +++ b/hugin-gopro-fusion/exif_batch.sh @@ -18,10 +18,10 @@ function batch_exif_photos { for i in $(seq $min $max); do filename=$i file="$dir/GF0$filename.JPG" - file_assemblage="/home/poule/encrypted/stockage-syncable/photos/imageries/gopro/rouen_sequence_stiched/assemblage_0$i.JPG" + file_assemblage="/home/poule/encrypted/stockage-syncable/photos/imageries/gopro/hugin_assemblages_script_output/assemblage_0$i.jpg" if [ -f "$file" ] && [ -f "$file_assemblage" ]; then - echo "set the tags in assemblage $i from GF0$filename.JPG" + echo "set the tags in assemblage $i from GF0$filename.jpg" exiftool -tagsFromFile "$file" $file $file_assemblage -overwrite_original echo "updated the exift tags of $file_assemblage" else @@ -30,4 +30,4 @@ function batch_exif_photos { done } -batch_exif_photos $1 $2 \ No newline at end of file +batch_exif_photos $1 $2 diff --git a/hugin-gopro-fusion/main.ts b/hugin-gopro-fusion/main.ts index 641bef45..42a08d97 100644 --- a/hugin-gopro-fusion/main.ts +++ b/hugin-gopro-fusion/main.ts @@ -23,7 +23,7 @@ let gorpro_fusion_separated_photos_folder = 'rouen_oct23' let goproMin = '80800'// numéro de photo gopro minimum front et back. correspond à GF080800.JPG + GB080800.JPG let goproMax = '80866' // et maximum. correspond à GF080866.JPG + GB080866.JPG let addExifToolInScript = true; - +let outputStitchedFolder = '/home/poule/encrypted/stockage-syncable/photos/imageries/gopro/hugin_assemblages_script_output' let hugin_batch_command = 'bash /home/poule/encrypted/stockage-syncable/www/development/html/scripts/hugin-gopro-fusion/exif_batch.sh '+goproMin+' '+goproMax if (mini_arguments['addExifToolInScript']) { addExifToolInScript = mini_arguments['addExifToolInScript'] @@ -92,11 +92,14 @@ function makeBashScriptHugin(minmax: any) { let ptoPath = `${dossier_pto_output}/${ptoFileName}` scriptsContent += '\n\n# capture n°' + currentNumber - scriptsContent += '\nhugin_executor' + - ' ' + ptoPath + ' ' + - '--stitching ' + - '--prefix=' + stitchedFileName + - ' -t=6' + scriptsContent += '\nif [ -f '+outputStitchedFolder+stitchedFileName+'.jpg ]; then ' + + 'hugin_executor' + + ' ' + ptoPath + ' ' + + '--stitching ' + + '--prefix=' + stitchedFileName + + ' -t=6'+ + '\n' + + 'fi'