PHP code example of antodippo / exif-reader

1. Go to this page and download the library: Download antodippo/exif-reader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

antodippo / exif-reader example snippets


$exifReader = new Reader();

try {
    $exifData = $exifReader->read('/tests/images/with-coordinates.jpg');
} catch (CannotReadExifData $e) {
    echo 'Cannot read exif data: ' . $e->getMessage();
}

echo $exifData->getCameraData()->getMaker();        // Sony
echo $exifData->getCameraData()->getModel();        // F5121
echo $exifData->getFileData()->getTakenDate();      // 2017-06-09 18:43:32
echo $exifData->getGeoLocation()->getLatitude();    // 64.25784
echo $exifData->getGeoLocation()->getLongitude();   // -21.121168