library photogps
读取照片的GPS定位信息
jockchou/photogps
读取照片的GPS定位信息
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
ReadPhotoGPS
reads the GPS coordinate data from a JPEG or TIFF image file. This way you can GPS data generated by digital cameras., (*1)
Dependecies
- PHP >= 4.2.0
- php_mbstring
- php_exif
1. Installing
Easy install via composer. Still no idea what composer is? Inform yourself here., (*2)
{
"require": {
"jockchou/photogps": "*"
}
}
2. Usage
require_once(__DIR__ . '/../vendor/autoload.php');
$pg = new \PhotoGps\PhotoGps(__DIR__ . "/../test-1.jpg");
var_dump($pg->coordinate());
/*
array(2) {
["longitude"]=>
float(113.92439166667)
["latitude"]=>
float(22.529294444444)
}
*/
//when photo has no gps info
$pg->setFilename(__DIR__ . "/../test-2.jpg");
var_dump($pg->coordinate()); //bool(false)
3. License
jockchou/photogps is freely distributable under the terms of the MIT license., (*3)
Copyright (c) 2016 jockchou (jockchou@qq.com), (*4)