From d25900b800bc3f62a95ee6b97d85940410a7b341 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 28 Sep 2024 23:07:34 +1000 Subject: [PATCH] Allow for gps details not being in QuickTime meta --- app/Media/QuickTime/Atoms/moov/meta.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Media/QuickTime/Atoms/moov/meta.php b/app/Media/QuickTime/Atoms/moov/meta.php index 32b654a..7fbdacb 100644 --- a/app/Media/QuickTime/Atoms/moov/meta.php +++ b/app/Media/QuickTime/Atoms/moov/meta.php @@ -27,11 +27,14 @@ class meta extends SubAtom { switch ($key) { case 'gps': - $m = []; - $gps = Arr::get($this->cache,'mdta.com.apple.quicktime.location.ISO6709'); - preg_match('/^([+-][0-9]{2,6}(?:\.[0-9]+)?)([+-][0-9]{3,7}(?:\.[0-9]+)?)([+-][0-9]+(?:\.[0-9]+)?)?/',$gps,$m); + if ($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); - 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': return Arr::get($this->gps,'alt');