aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-08-19 19:17:17 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-08-19 19:17:17 -0700
commit69920fb7173887f83052e682d5273b16e9c34c49 (patch)
tree24ef57a1977a109a5b30355b76194e71ff310b80
parent863a9797544a80671c179355ff31c73032e88fb7 (diff)
downloadvolse-hubzilla-69920fb7173887f83052e682d5273b16e9c34c49.tar.gz
volse-hubzilla-69920fb7173887f83052e682d5273b16e9c34c49.tar.bz2
volse-hubzilla-69920fb7173887f83052e682d5273b16e9c34c49.zip
fix photo location
-rw-r--r--include/photo/photo_driver.php3
-rw-r--r--include/photos.php12
2 files changed, 13 insertions, 2 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index 426eb6aac..553e77ed1 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -238,10 +238,12 @@ abstract class photo_driver {
if(! $this->is_valid())
return FALSE;
+
if((! function_exists('exif_read_data')) || ($this->getType() !== 'image/jpeg'))
return;
$exif = @exif_read_data($filename,null,true);
+
if($exif) {
$ort = $exif['IFD0']['Orientation'];
@@ -281,7 +283,6 @@ abstract class photo_driver {
break;
}
- // logger('exif: ' . print_r($exif,true));
return $exif;
}
diff --git a/include/photos.php b/include/photos.php
index 7437d6aa9..cb7fabc98 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -166,7 +166,7 @@ function photo_upload($channel, $observer, $args) {
return $ret;
}
- $exif = $ph->orient($src);
+ $exif = $ph->orient(($args['os_path']) ? $args['os_path'] : $src);
@unlink($src);
@@ -579,6 +579,16 @@ function getGps($exifCoord, $hemi) {
return floatval($flip * ($degrees + ($minutes / 60) + ($seconds / 3600)));
}
+function getGpstimestamp($exifCoord) {
+
+ $hours = count($exifCoord) > 0 ? gps2Num($exifCoord[0]) : 0;
+ $minutes = count($exifCoord) > 1 ? gps2Num($exifCoord[1]) : 0;
+ $seconds = count($exifCoord) > 2 ? gps2Num($exifCoord[2]) : 0;
+
+ return sprintf('%02d:%02d:%02d',$hours,$minutes,$seconds);
+}
+
+
function gps2Num($coordPart) {
$parts = explode('/', $coordPart);