Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/easygithdev/imgmeta
Wrapper to access Exif and IPTC data from an image
https://github.com/easygithdev/imgmeta
Last synced: 21 days ago
JSON representation
Wrapper to access Exif and IPTC data from an image
- Host: GitHub
- URL: https://github.com/easygithdev/imgmeta
- Owner: EasyGithDev
- License: gpl-3.0
- Created: 2019-05-10T09:53:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-09T21:24:52.000Z (over 4 years ago)
- Last Synced: 2023-08-21T10:02:01.838Z (over 1 year ago)
- Language: PHP
- Size: 68.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ImgMeta
Wrapper to access Exif and IPTC data from an image.
### Installing
Installation is quite typical - with composer:
```
composer require easygithdev/imgmeta
```## How to use
Include the autoload, if you need.
```
read($stream)->getMetas();
```Fetching the EXIF or IPTC tags :
```
$imgData->read($stream)->getExif()->fetch(ExifTags::Copyright);
$imgData->read($stream)->getIptc()->fetch(IptcTags::City);
```Or you can use the quick acces :
```
(new ImgData())->read($stream)->exif('Copyright');
(new ImgData())->read($stream)->iptc('City');
```### Working with EXIF only
Get all the datas :
```
$imgData = new ImgData();
$exifManager = $imgData->createExifManager();
$exifManager->read(ExifReader::getReader($stream));
$exifManager->getMetas();
```Fetch one tag :
```
$exifManager->fetch(ExifTags::Copyright);
```Or :
```
$exifManager->fetch('Copyright');
```For example to fetch the GPS informations :
```
$latitude = $exifManager->fetch('GPSLatitude');
$longitude = $exifManager->fetch('GPSLongitude');
```Using helper to get the GPS infos :
```
$exifManager->getPosition();
```### Working with IPTC only
```
$imgData = new ImgData();
$iptcManager = $imgData->createIptcManager();
$iptcManager->read(IptcReader::getReader($stream));
```Get IPTC default format :
```
$iptcManager->getMetas();
```Get IPTC by Key :
```
$iptcManager->getMetasByKey();
```Get IPTC by Name :
```
$iptcManager->getMetasByName();
```Get IPTC by name with all keys :
```
$iptcManager->getAssocMetas(IptcManager::META_BY_NAME, true);
```Fetch one tag, datas are flatten :
```
$iptcManager->fetch(IptcTags::Country_PrimaryLocationName);
```Fetch one tag, datas are originals :
```
$iptcManager->fetchAll(IptcTags::Country_PrimaryLocationName);
```## License
This project is licensed under GNU license - see the [LICENSE](LICENSE) file for deta