Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (46 sloc) 1.78 KB


Build Status

PHP Exiftool is an Object Oriented driver for Phil Harvey's Exiftool (see Exiftool is a powerfull library and command line utility for reading, writing and editing meta information written in Perl.

PHPExiftool provides an intuitive object oriented interface to read and write metadatas.

You will find some example below, but I strongly recommend you to read the full documentation.

This driver is not suitable for production, it is still under heavy development.

##Exiftool Reader

use PHPExiftool\Reader;
use PHPExiftool\Driver\Value\Value;

$Reader = Reader::create();

  ->in(array('documents', '/Picture'))
  ->extensions(array('doc', 'jpg', 'cr2', 'dng'))
  ->exclude(array('test', 'tmp'))

foreach ($Reader as $MetaDatas) {
    echo "found file " . $MetaDatas->getFile() . "\n";

    foreach ($MetaDatas as $metadata) {
        if ($metadata->getValue()->getType() === Value::TYPE_BINARY) {
            echo sprintf("\t--> Field %s has binary datas" . PHP_EOL, $metadata->getTag());
        } else {
            echo sprintf("\t--> Field %s has value(s) %s" . PHP_EOL, $metadata->getTag(), $metadata->getValue()->asString());

##Exiftool Writer

use PHPExiftool\Writer;
use PHPExiftool\Driver\Metadata;
use PHPExiftool\Driver\MetadataBag;
use PHPExiftool\Driver\Tag\IPTC\ObjectName;
use PHPExiftool\Driver\Value\Mono;

$Writer = Writer::create();

$bag = new MetadataBag();
$bag->add(new Metadata(new ObjectName(), new Mono('Pretty cool subject')));

$Writer->write('image.jpg', $bag);


Project licensed under the MIT License