Skip to content

PHPExif/php-exif

Repository files navigation

PHPExif is a library which gives you easy access to the EXIF meta-data of an image.

PHPExif serves as a wrapper around some native or CLI tools which access this EXIF meta-data from an image. As such, it provides a standard API for retrieving and accessing that information.

Supported tools

  • Native PHP functionality (exif_read_data, iptcparse)
  • Exiftool adapter (wrapper for the exiftool binary)

Installation (composer)

"miljar/php-exif": "0.*"

Usage

Using factory method

<?php
// reader with Native adapter
$reader = \PHPExif\Reader::factory(\PHPExif\Reader::TYPE_NATIVE);

// reader with Exiftool adapter
//$reader = \PHPExif\Reader::factory(\PHPExif\Reader::TYPE_EXIFTOOL);

$exif = $reader->getExifFromFile('/path/to/file');

echo 'Title: ' . $exif->getTitle() . PHP_EOL;

Using custom options

<?php
$adapter = new \PHPExif\Reader\Adapter\Exiftool(
    array(
        'toolPath'  => '/path/to/exiftool',
    )
);
$reader = new \PHPExif\Reader($adapter);

$exif = $reader->getExifFromFile('/path/to/file');

echo 'Title: ' . $exif->getTitle() . PHP_EOL;

Contributing

Please submit all pull requests against the correct branch. The release branch for the next version is a branch with the same name as the next version. Bugfixes should go in the master branch, unless they are for code in a new release branch.

PHPExif is written according the PSR-0/1/2 standards. When submitting code, please make sure it is conform these standards.

All contributions are welcomed and greatly appreciated.

Feedback

Have a bug or a feature request? Please open a new issue. Before opening any issue, please search for existing issues.

License

MIT License

About

📷 PHPExif - A PHP Exif reader

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 15

Languages