????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.48 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/appsrv.astacus.se/XMP/viewer/ |
Upload File : |
<?php
if($_GET['project'] != ""){
$project = $_GET['project'];
}else {
$project = "002";
}
$dir = '/var/www/appsrv.astacus.se/XMP/data/'.$project;
$images = preg_grep('~\.(xmp)$~', scandir($dir));
$strarray = Array();
foreach ($images as &$value)
{
$file = "https://appsrv.astacus.se/XMP/data/".$project."/".$value;
$file_low = "https://appsrv.astacus.se/XMP/data/".$project."/low/".$value;
$fileContents = file_get_contents($file);
$fileContents = str_replace(array("\n", "\r", "\t","\"","+"), '', $fileContents);
$GpsLatitude = getValue($fileContents, "drone-dji:GpsLatitude", 1);
$GpsLongitude = getValue($fileContents, "drone-dji:GpsLongitude", 1);
$GpsLongtitude = getValue($fileContents, "drone-dji:GpsLongtitude", 1);
$GimbalRollDegree = getValue($fileContents, "drone-dji:GimbalRollDegree", 1);
$GimbalYawDegree = getValue($fileContents, "drone-dji:GimbalYawDegree", 1);
$GimbalPitchDegree = getValue($fileContents, "drone-dji:GimbalPitchDegree", 1);
$FlightRollDegree = getValue($fileContents, "drone-dji:FlightRollDegree", 1);
$FlightYawDegree = getValue($fileContents, "drone-dji:FlightYawDegree", 1);
$FlightPitchDegree = getValue($fileContents, "drone-dji:FlightPitchDegree", 1);
if(!is_numeric($GpsLongitude))
{
$GpsLongitude = $GpsLongtitude;
}
$fileName = substr($file, 0, strlen($file)-3) .'JPG';
$fileName_low = substr($file_low, 0, strlen($file_low)-3) .'jpg';
$GpsAltitude = 40;
$str = Array(
'placeName' => $fileName,
'placeName_low' => $fileName_low,
'fligthParameters' => "FlightRollDegree: '.$FlightRollDegree.', FlightYawDegree: '.$FlightYawDegree.', FlightPitchDegree: '.$FlightPitchDegree.', GimbalRollDegree: '.$GimbalRollDegree.', GimbalYawDegree: '.$GimbalYawDegree.', GimbalPitchDegree: '.$GimbalPitchDegree.'",
'FlightYawDegree' => trim(round($FlightYawDegree)),
'GimbalYawDegree' => trim(round($GimbalYawDegree)),
'GimbalPitchDegree' => trim(round($GimbalPitchDegree)),
'LatLng' => Array(Array(
'lat' => floatval(floatval($GpsLatitude)),
'lng' => floatval(floatval($GpsLongitude)),
'altitude' => floatval(floatval($GpsAltitude))
))
);
array_push($strarray, $str);
}//foreach
function getValue($fileContents, $variable, $offset)
{
$pos = strpos($fileContents, $variable);
$value = substr($fileContents, ($pos+strlen($variable)+$offset), 8);
return $value;
}
echo json_encode($strarray);
?>