|
1 | | -Master: [](https://travis-ci.org/Miljar/php-exif) |
2 | | -v0.1: [](https://travis-ci.org/Miljar/php-exif) |
| 1 | +# [PHPExif v0.2](http://github.com/Miljar/php-exif) [](https://travis-ci.org/Miljar/php-exif) |
| 2 | + |
| 3 | +PHPExif is a library which gives you easy access to the EXIF meta-data of an image. |
| 4 | + |
| 5 | +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. |
| 6 | + |
| 7 | +## Supported tools |
| 8 | + |
| 9 | +* Native PHP functionality (exif_read_data, iptcparse) |
| 10 | +* [Exiftool](http://www.sno.phy.queensu.ca/~phil/exiftool/) adapter (wrapper for the exiftool binary) |
| 11 | + |
| 12 | +## Installation (composer) |
| 13 | + |
| 14 | +```json |
| 15 | +"miljar/php-exif": "0.*" |
| 16 | +``` |
| 17 | + |
| 18 | + |
| 19 | +## Usage |
| 20 | + |
| 21 | +### Using factory method |
| 22 | + |
| 23 | +```php |
| 24 | +<?php |
| 25 | +// reader with Native adapter |
| 26 | +$reader = \PHPExif\Reader::factory(\PHPExif\Reader::TYPE_NATIVE); |
| 27 | + |
| 28 | +// reader with Exiftool adapter |
| 29 | +//$reader = \PHPExif\Reader::factory(\PHPExif\Reader::TYPE_EXIFTOOL); |
| 30 | + |
| 31 | +$exif = $reader->getExifFromFile('/path/to/file'); |
| 32 | + |
| 33 | +echo 'Title: ' . $exif->getTitle() . PHP_EOL; |
| 34 | +``` |
| 35 | + |
| 36 | +### Using custom options |
| 37 | + |
| 38 | +```php |
| 39 | +<?php |
| 40 | +$adapter = new \PHPExif\Reader\Adapter\Exiftool( |
| 41 | + array( |
| 42 | + 'toolPath' => '/path/to/exiftool', |
| 43 | + ) |
| 44 | +); |
| 45 | +$reader = new \PHPExif\Reader($adapter); |
| 46 | + |
| 47 | +$exif = $reader->getExifFromFile('/path/to/file'); |
| 48 | + |
| 49 | +echo 'Title: ' . $exif->getTitle() . PHP_EOL; |
| 50 | +``` |
| 51 | + |
| 52 | +## Contributing |
| 53 | + |
| 54 | +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. |
| 55 | + |
| 56 | +PHPExif is written according the [PSR-0/1/2 standards](http://www.php-fig.org/). When submitting code, please make sure it is conform these standards. |
| 57 | + |
| 58 | +All contributions are welcomed and greatly appreciated. |
| 59 | + |
| 60 | +## Feedback |
| 61 | + |
| 62 | +Have a bug or a feature request? [Please open a new issue](https://github.com/Miljar/php-exif/issues). Before opening any issue, please search for existing issues. |
| 63 | + |
| 64 | +## License |
| 65 | + |
| 66 | +[MIT License](http://github.com/Miljar/php-exif/blob/master/LICENSE) |
0 commit comments