From d9908c043fc781a3e98e9e395d48b628e02d598c Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 28 Sep 2024 23:19:01 +1000 Subject: [PATCH] Allow for gps data that doesnt include altitude --- app/Media/QuickTime/Atoms/moov/meta.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Media/QuickTime/Atoms/moov/meta.php b/app/Media/QuickTime/Atoms/moov/meta.php index 7fbdacb..d77cec7 100644 --- a/app/Media/QuickTime/Atoms/moov/meta.php +++ b/app/Media/QuickTime/Atoms/moov/meta.php @@ -31,7 +31,7 @@ class meta extends SubAtom $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'=>isset($m[3]) ? (float)$m[3] : NULL]; } else { return NULL; }