From cb7e512c2cca6518304de31c662ab706d64030b1 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Thu, 11 Mar 2010 02:07:37 +0800 Subject: [PATCH] Bug Fix for GPS-tagged photos that spell out South and West. --- modules/exif_gps/helpers/exif_gps.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/exif_gps/helpers/exif_gps.php b/modules/exif_gps/helpers/exif_gps.php index 1cab6558..c72fb7e2 100644 --- a/modules/exif_gps/helpers/exif_gps.php +++ b/modules/exif_gps/helpers/exif_gps.php @@ -52,10 +52,10 @@ class exif_gps_Core { $record->latitude = str_replace(",", ".", $keys["Latitude"]); $record->longitude = str_replace(",", ".", $keys["Longitude"]); // Represent N/S/E/W as postive and negative numbers - if ($keys["Latitude Reference"] == "S") { + if (substr(strtoupper($keys["Latitude Reference"]), 0, 1) == "S") { $record->latitude = "-" . $record->latitude; } - if ($keys["Longitude Reference"] == "W") { + if (substr(strtoupper($keys["Longitude Reference"]), 0, 1) == "W") { $record->longitude = "-" . $record->longitude; } $record->save();