fixed the last line coma bug on frames.json export
This commit is contained in:
+14
-4
@@ -45,23 +45,33 @@ function convert {
|
|||||||
rsync -r tmp_videos/ public_html/videos/
|
rsync -r tmp_videos/ public_html/videos/
|
||||||
|
|
||||||
echo "metadata export"
|
echo "metadata export"
|
||||||
|
l=0
|
||||||
|
for pict in public_html/pictures/*.jpg; do
|
||||||
|
l=$((l+1))
|
||||||
|
done
|
||||||
f=0
|
f=0
|
||||||
|
|
||||||
echo -e '{' > tmp_metadata/frames.json
|
echo -e '{' > tmp_metadata/frames.json
|
||||||
echo -e '\t"frames":[' >> tmp_metadata/frames.json
|
echo -e '\t"frames":[' >> tmp_metadata/frames.json
|
||||||
|
|
||||||
for pict in public_html/pictures/*.jpg; do
|
for pict in public_html/pictures/*.jpg; do
|
||||||
# SRC
|
# SRC
|
||||||
src="${pict/public_html\/pictures\//}"
|
src="${pict/public_html\/pictures\//}"
|
||||||
# TIME
|
# TIME
|
||||||
# time="${pict/public_html\/pictures\/hehe-/}"
|
# time="${pict/public_html\/pictures\/hehe-/}"
|
||||||
# time="${time/.jpg/}"
|
# time="${time/.jpg/}"
|
||||||
time=`exiftool 2>/dev/null -S --DateTimeOriginal -p '$DateTimeOriginal' -d %Y-%m-%dT%T "$pict"`
|
datetime=`exiftool 2>/dev/null -S --DateTimeOriginal -p '$DateTimeOriginal' -d %Y-%m-%dT%T "$pict"`
|
||||||
# GPS
|
# GPS
|
||||||
gps=`exiftool 2>/dev/null -n -p '$GPSLatitude,$GPSLongitude' $pict`
|
gps=`exiftool 2>/dev/null -n -p '$GPSLatitude,$GPSLongitude' $pict`
|
||||||
|
|
||||||
# FRAME
|
# FRAME
|
||||||
frame=$(((60/$vf)*$f))
|
currenttime=$(((1/$pf)*$f))
|
||||||
echo -e "\t\t{\"src\":\"$src\", \"time\":\"$time\", \"gps\":\"$gps\", \"frame\":\"$frame\"}," >> tmp_metadata/frames.json
|
|
||||||
|
if [[ $f == $(($l-1)) ]]; then
|
||||||
|
echo -e "\t\t{\"src\":\"$src\", \"datetime\":\"$datetime\", \"gps\":\"$gps\", \"currenttime\":\"$currenttime\"}" >> tmp_metadata/frames.json
|
||||||
|
else
|
||||||
|
echo -e "\t\t{\"src\":\"$src\", \"datetime\":\"$datetime\", \"gps\":\"$gps\", \"currenttime\":\"$currenttime\"}," >> tmp_metadata/frames.json
|
||||||
|
fi
|
||||||
|
|
||||||
f=$(($f+1))
|
f=$(($f+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user