3 check_success_read_lat
()
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"
15 check_success_read_lon
()
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"
27 # Enable running in test directory or via make distcheck when $srcdir is defined
28 if [ -z "$srcdir" ]; then
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
40 result
=$
(.
/geotag_write tmp.jpg
)
42 echo "geotag_write failure - result is=$result"
45 check_success_read_lat
51.179489 tmp.jpg
46 check_success_read_lon
-1.826217 tmp.jpg