scripts/hugin-gopro-fusion/exif_batch.sh

79 lines
2.8 KiB
Bash
Raw Permalink 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"
# test with previous zero
2024-02-24 10:27:55 +01:00
if [ -f "$file_assemblage_with_zero" ]; then
echo "."
else
echo "missing assemblage with zero $file_assemblage_with_zero"
fi
if [ -f "$file_assemblage" ]; then
echo "."
else
echo "missing assemblage $file_assemblage_with_zero"
fi
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
2024-02-24 10:27:55 +01:00
echo "/!\ batch_exif_photos: File with zero:
$file_with_zero
does not exist."
# 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"
2024-02-24 10:27:55 +01:00
# else
# echo "/!\ batch_exif_photos: File:
# $file
# OR assemblage:
# $file_assemblage
# does not exist."
# fi
fi
done
2024-02-07 22:30:01 +01:00
echo "# fin des assemblages exif de $1 à $2"
}
batch_exif_photos $1 $2 $3
2024-02-24 10:27:55 +01:00
bash /home/poule/encrypted/stockage-syncable/www/development/html/scripts/hugin-gopro-fusion/move_batch.sh $1 $2
# bash /home/poule/encrypted/stockage-syncable/www/development/html/scripts/hugin-gopro-fusion/remove_pto_batch.sh $1 $2