@@ -15,22 +15,27 @@ composer require vvval/exiftool-reader
1515## Example usage
1616``` php
1717<?php
18- /**
19- * @var ExiftoolReader\Reader $reader
20- * @var ExiftoolReader\Result $output
21- * @var ExiftoolReader\Metadata $metadata
22- */
18+ $exiftoolConfig = new \ExiftoolReader\Config\Exiftool();
19+ $command = new \ExiftoolReader\Command($exiftoolConfig);
20+ $mapperConfig = new \ExiftoolReader\Config\Mapper();
21+ $utils = new \ExiftoolReader\Utils();
22+
23+ $reader = new \ExiftoolReader\Reader($command);
24+ $metadata = new \ExiftoolReader\Metadata($mapperConfig, $utils);
25+
26+ /** @var ExiftoolReader\Result $output */
2327$output = $reader->read('filename');
2428
2529/**
2630 * Full metadata array.
2731 */
2832$decoded = $output->getDecoded();
29- var_dump($decoded); // ['title' => '...', 'description' => '...', ...]
33+ var_dump($decoded); // ['title' => '...', 'description' => '...', /* ... other fields */ ]
3034
3135/**
3236 * Fetched specified metadata keys.
33- * Uses aliases to find values, for example Title|ObjectName, Description|Caption-Abstract|ImageDescription, etc...
37+ * Uses aliases to find values,
38+ * for example Title|ObjectName, Description|Caption-Abstract|ImageDescription, etc...
3439 */
3540$fetchedData = $metadata->fetch($output, ['title', 'description']);
3641var_dump($fetchedData); // ['title' => '...', 'description' => '...']
0 commit comments