@@ -15,22 +15,27 @@ composer require vvval/exiftool-reader
15
15
## Example usage
16
16
``` php
17
17
<?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 */
23
27
$output = $reader->read('filename');
24
28
25
29
/**
26
30
* Full metadata array.
27
31
*/
28
32
$decoded = $output->getDecoded();
29
- var_dump($decoded); // ['title' => '...', 'description' => '...', ...]
33
+ var_dump($decoded); // ['title' => '...', 'description' => '...', /* ... other fields */ ]
30
34
31
35
/**
32
36
* 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...
34
39
*/
35
40
$fetchedData = $metadata->fetch($output, ['title', 'description']);
36
41
var_dump($fetchedData); // ['title' => '...', 'description' => '...']
0 commit comments