Allow for gps details not being in QuickTime meta
This commit is contained in:
parent
1151d43bee
commit
d25900b800
@ -27,11 +27,14 @@ class meta extends SubAtom
|
|||||||
{
|
{
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
case 'gps':
|
case 'gps':
|
||||||
$m = [];
|
if ($gps=Arr::get($this->cache,'mdta.com.apple.quicktime.location.ISO6709')) {
|
||||||
$gps = Arr::get($this->cache,'mdta.com.apple.quicktime.location.ISO6709');
|
$m = [];
|
||||||
preg_match('/^([+-][0-9]{2,6}(?:\.[0-9]+)?)([+-][0-9]{3,7}(?:\.[0-9]+)?)([+-][0-9]+(?:\.[0-9]+)?)?/',$gps,$m);
|
preg_match('/^([+-][0-9]{2,6}(?:\.[0-9]+)?)([+-][0-9]{3,7}(?:\.[0-9]+)?)([+-][0-9]+(?:\.[0-9]+)?)?/',$gps,$m);
|
||||||
|
|
||||||
return ['lat'=>(float)$m[1],'lon'=>(float)$m[2],'alt'=>(float)$m[3]];
|
return ['lat'=>(float)$m[1],'lon'=>(float)$m[2],'alt'=>(float)$m[3]];
|
||||||
|
} else {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
case 'gps_altitude':
|
case 'gps_altitude':
|
||||||
return Arr::get($this->gps,'alt');
|
return Arr::get($this->gps,'alt');
|
||||||
|
Loading…
Reference in New Issue
Block a user