aboutsummaryrefslogtreecommitdiffstats
path: root/include/photos.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-03-13 22:47:11 -0700
committerzotlabs <mike@macgirvin.com>2018-03-13 22:47:11 -0700
commit128d1f7aa8a11e0394913a10daef56cd4be450b1 (patch)
tree00b22cc9a3c7472cce0c824c04ca7a40c97ee185 /include/photos.php
parent09a841f3be2953fa8e346be9259b43cf68920741 (diff)
downloadvolse-hubzilla-128d1f7aa8a11e0394913a10daef56cd4be450b1.tar.gz
volse-hubzilla-128d1f7aa8a11e0394913a10daef56cd4be450b1.tar.bz2
volse-hubzilla-128d1f7aa8a11e0394913a10daef56cd4be450b1.zip
somewhere along the line the output of exif_read_data() changed and it no longer provides populated sections. Adjust for the new format and allow for the old because I cannot find documentation of this change anywhere. This affects photo rotation and the photo map feature.
Diffstat (limited to 'include/photos.php')
-rw-r--r--include/photos.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/photos.php b/include/photos.php
index b1391f284..321f7159c 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -333,10 +333,17 @@ function photo_upload($channel, $observer, $args) {
$lat = $lon = null;
- if($exif && $exif['GPS']) {
- if(feature_enabled($channel_id,'photo_location')) {
- $lat = getGps($exif['GPS']['GPSLatitude'], $exif['GPS']['GPSLatitudeRef']);
- $lon = getGps($exif['GPS']['GPSLongitude'], $exif['GPS']['GPSLongitudeRef']);
+ if($exif && feature_enabled($channel_id,'photo_location')) {
+ $gps = null;
+ if(array_key_exists('GPS',$exif)) {
+ $gps = $exif['GPS'];
+ }
+ elseif(array_key_exists('GPSLatitude',$exif)) {
+ $gps = $exif;
+ }
+ if($gps) {
+ $lat = getGps($gps['GPSLatitude'], $gps['GPSLatitudeRef']);
+ $lon = getGps($gps['GPSLongitude'], $gps['GPSLongitudeRef']);
}
}