Add missing trailing dot in sentences
[viking/guyou.git] / test / check_geotag.sh
blob461310033c2db599e817224bab0262abfafd30d4
1 #!/bin/sh
3 check_success_read_lat ()
5 expected=$1
6 shift
7 result=$(./geotag_read "$1" | cut -d' ' -f1)
8 diff=$(echo "$result - $expected" | bc -l)
9 if [ $diff != 0 ]; then
10 echo "Expected=$expected but result is=$result"
11 exit 1
15 check_success_read_lon ()
17 expected=$1
18 shift
19 result=$(./geotag_read "$1" | cut -d' ' -f2)
20 diff=$(echo "$result - $expected" | bc -l)
21 if [ $diff != 0 ]; then
22 echo "Expected=$expected but result is=$result"
23 exit 1
27 # Enable running in test directory or via make distcheck when $srcdir is defined
28 if [ -z "$srcdir" ]; then
29 srcdir=.
32 # Read test
33 check_success_read_lat 51.881861 $srcdir/ViewFromCribyn-Wales-GPS.jpg
34 check_success_read_lon -3.419592 $srcdir/ViewFromCribyn-Wales-GPS.jpg
36 # Write and then re-read test
37 cp $srcdir/Stonehenge.jpg tmp.jpg
38 chmod +w tmp.jpg
40 result=$(./geotag_write tmp.jpg)
41 if [ $? != 0 ]; then
42 echo "geotag_write failure - result is=$result"
43 exit 1
45 check_success_read_lat 51.179489 tmp.jpg
46 check_success_read_lon -1.826217 tmp.jpg
47 rm tmp.jpg
49 exit 0