-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Use php-exif without composer thus:
<?php
// Ref: https://github.com/PHPExif/php-exif
// Ref: https://github.com/LycheeOrg/php-exif supports video and altitude too
$path_to_exiflib = '../../libraries/PHPExif/';
require_once($path_to_exiflib.'Adapter/AdapterInterface.php');
require_once($path_to_exiflib.'Adapter/AdapterAbstract.php');
require_once($path_to_exiflib.'Adapter/Exiftool.php');
require_once($path_to_exiflib.'Adapter/Native.php');
require_once($path_to_exiflib.'Adapter/NoAdapterException.php');
require_once($path_to_exiflib.'Hydrator/HydratorInterface.php');
require_once($path_to_exiflib.'Hydrator/Mutator.php');
require_once($path_to_exiflib.'Mapper/MapperInterface.php');
require_once($path_to_exiflib.'Mapper/Exiftool.php');
require_once($path_to_exiflib.'Mapper/Native.php');
require_once($path_to_exiflib.'Reader/ReaderInterface.php');
require_once($path_to_exiflib.'Reader/Reader.php');
require_once($path_to_exiflib.'Exif.php');
$reader = \PHPExif\Reader\Reader::factory(\PHPExif\Reader\Reader::TYPE_NATIVE);
$exif = $reader->read('./test.jpg');
echo 'GPS: ' . $exif->getGPS() . PHP_EOL;
// 13.054053400000001,80.257204999722219
// https://www.google.com/maps/@13.0540534,80.257205,15z
// 15z is the zoom out factor
Get sample images with GPS data for testing from:
https://github.com/ianare/exif-samples
GPS and other meta tags are also available in videos and so is the Altitude parameter - all these are enabled in the the following fork:
https://github.com/LycheeOrg/php-exif
Here is an article on Meta Data Extraction:
https://www.hackingarticles.in/exiftool-a-meta-data-extractor/
Extract Exif Data to a CSV file using the tool from:
http://www.br-software.com/extracter.html
Metadata
Metadata
Assignees
Labels
No labels

