fix photo location
This commit is contained in:
parent
863a979754
commit
69920fb717
@ -238,10 +238,12 @@ abstract class photo_driver {
|
|||||||
if(! $this->is_valid())
|
if(! $this->is_valid())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
||||||
if((! function_exists('exif_read_data')) || ($this->getType() !== 'image/jpeg'))
|
if((! function_exists('exif_read_data')) || ($this->getType() !== 'image/jpeg'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$exif = @exif_read_data($filename,null,true);
|
$exif = @exif_read_data($filename,null,true);
|
||||||
|
|
||||||
if($exif) {
|
if($exif) {
|
||||||
$ort = $exif['IFD0']['Orientation'];
|
$ort = $exif['IFD0']['Orientation'];
|
||||||
|
|
||||||
@ -281,7 +283,6 @@ abstract class photo_driver {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// logger('exif: ' . print_r($exif,true));
|
|
||||||
return $exif;
|
return $exif;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ function photo_upload($channel, $observer, $args) {
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
$exif = $ph->orient($src);
|
$exif = $ph->orient(($args['os_path']) ? $args['os_path'] : $src);
|
||||||
|
|
||||||
@unlink($src);
|
@unlink($src);
|
||||||
|
|
||||||
@ -579,6 +579,16 @@ function getGps($exifCoord, $hemi) {
|
|||||||
return floatval($flip * ($degrees + ($minutes / 60) + ($seconds / 3600)));
|
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) {
|
function gps2Num($coordPart) {
|
||||||
|
|
||||||
$parts = explode('/', $coordPart);
|
$parts = explode('/', $coordPart);
|
||||||
|
Reference in New Issue
Block a user