Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Without Composer #80

Open
apmuthu opened this issue May 26, 2020 · 0 comments
Open

Without Composer #80

apmuthu opened this issue May 26, 2020 · 0 comments

Comments

@apmuthu
Copy link

apmuthu commented May 26, 2020

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

Extractor_UI

sample_output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant