I'm trying to read image exif data to determine its location. Unfortunately it appears it is stored in a convoluted manner.
$exif = exif_read_data($file, 0, true);
print_r($exif["GPS"]["GPSLatitude"]); // array("40/1","42/1","1224/25");
What I need to do is to resolve these fractions to get: 40, 42, 48.96
From that point I can take X+((Y+(Z/60))/60) = 40.7136
Unfortunately I cannot seem to resolve the fractions to even begin.
echo $exif["GPS"]["GPSLatitude"][2]; // 1224/25
echo floatval($exif["GPS"]["GPSLatitude"][2]); // 1224
echo floatval($exif["GPS"]["GPSLatitude"][2]*1); // 1224
echo ($exif["GPS"]["GPSLatitude"][2]*1); // 1224
What I'm trying to do is convert a string like 1224/25 to the number 48.96.