scripts/hugin-gopro-fusion/exif_batch.sh

59 lines
2.2 KiB
Bash
Raw Normal View History

#!/bin/bash
# capture n°080530
#hugin_executor /home/poule/encrypted/stockage-syncable/www/development/html/scripts/hugin-gopro-fusion/output_pto/merging_080530.pto --stitching --prefix=assemblage_080530 -t=6
###################################
# complétion des données gps depuis une des photos assemblées
###################################
# exemple
# bash /home/poule/encrypted/stockage-syncable/www/development/html/scripts/hugin-gopro-fusion/exif_batch.sh 36077 38695 INBOX_a_assembler/rouen_3
# va assigner les données exif des photos gopro GF36077.JPG à leur assemblage assemblage_063077.jpg
2023-11-23 11:23:07 +01:00
#folder="rouen/rouen_oct23"
function batch_exif_photos {
2024-02-07 22:30:01 +01:00
echo "# assemblage des infos exif en batch"
local min=$1
local max=$2
local folder=$3
2023-11-23 11:23:07 +01:00
local dir="/home/poule/encrypted/stockage-syncable/photos/imageries/gopro/$folder"
echo "subdirectory of gopro is $dir"
echo $(seq $min $max)
for i in $(seq $min $max); do
filename=$i
filename_with_zero="0$i"
file="$dir/GF$filename.JPG"
file_with_zero="$dir/GF$filename_with_zero.JPG"
file_assemblage="/home/poule/encrypted/stockage-syncable/photos/imageries/gopro/hugin_assemblages_script_output/assemblage_$i.jpg"
file_assemblage_with_zero="/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 GF$filename.jpg"
exiftool -tagsFromFile "$file" $file $file_assemblage -overwrite_original
echo "updated the exift tags of $file_assemblage"
else
2023-11-23 18:10:09 +01:00
echo "batch_exif_photos: File $file does not exist."
fi
# test with previous zero
if [ -f "$file_with_zero" ] && [ -f "$file_assemblage_with_zero" ]; then
echo "set the tags in assemblage $i from GF$filename_with_zero.jpg"
exiftool -tagsFromFile "$file_with_zero" $file_with_zero $file_assemblage_with_zero -overwrite_original
echo "updated the exift tags of $file_assemblage_with_zero"
else
echo "batch_exif_photos: File $file_with_zero does not exist."
fi
done
2024-02-07 22:30:01 +01:00
echo "# fin des assemblages exif"
}
batch_exif_photos $1 $2 $3