3 * @file include/photos.php
4 * @brief Functions related to photo handling.
7 function getGps($exifCoord, $hemi) {
8 $degrees = count($exifCoord) > 0 ? gps2Num($exifCoord[0]) : 0;
9 $minutes = count($exifCoord) > 1 ? gps2Num($exifCoord[1]) : 0;
10 $seconds = count($exifCoord) > 2 ? gps2Num($exifCoord[2]) : 0;
12 $flip = ($hemi == 'W' or $hemi == 'S') ? -1 : 1;
14 return floatval($flip * ($degrees + ($minutes / 60) + ($seconds / 3600)));
17 function gps2Num($coordPart) {
18 $parts = explode('/', $coordPart);
20 if (count($parts) <= 0)
23 if (count($parts) == 1)
26 return floatval($parts[0]) / floatval($parts[1]);