wikimedia / xmp-reader
Reader for XMP data containing properties relevant to images
0.9.4
2024-11-03 12:28 UTC
Requires
- php: >=7.4.3
- ext-iconv: *
- ext-libxml: *
- ext-xml: *
- ext-xmlreader: *
- psr/log: ^1.0
- wikimedia/scoped-callback: ^1.0 || ^2.0 || ^3.0 || ^4.0 || ^5.0
- wikimedia/timestamp: ^1.0 || ^2.0 || ^3.0 || ^4.0
Requires (Dev)
- ext-exif: *
- mediawiki/mediawiki-codesniffer: 45.0.0
- mediawiki/mediawiki-phan-config: 0.14.0
- mediawiki/minus-x: 1.1.3
- ockcyp/covers-validator: 1.6.0
- php-parallel-lint/php-console-highlighter: 1.0.0
- php-parallel-lint/php-parallel-lint: 1.4.0
- phpunit/phpunit: 9.6.16
README
Reader for XMP data containing properties relevant to images, written in PHP.
Usage
composer require wikimedia/xmp-reader
use Wikimedia\XMPReader\Reader as XMPReader; //... // Check if the php instance has the required supported libraries to parse XMP $isXMPSupported = XMPReader::isSupported(); // Create a new instance $xmp = new XMPReader(); // or $xmp = new XMPReader( $logger, $filename ); // where $logger is an implementation of Psr\Log\LoggerInterface and $filename a string describing the origin of your XMP content // To parse XMP data in $string $xmp->parse( $string ); // To parse XMP Extended data in $string $xmp->parseExtended( $string ); // To retrieve the parsed results $results = $xmp->getResults();
The parsed results are returned in an array of 3 potential groups, which indicate their priority according to the Metadata Working Group guidance. http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf
[ 'xmp-exif' => [], 'xmp-general' => [], 'xmp-deprecated' => [], ]
Supported XMP
Most of the following metadata sets are supported
- http://ns.adobe.com/exif/1.0/
- http://ns.adobe.com/tiff/1.0/
- http://ns.adobe.com/exif/1.0/aux/
- http://purl.org/dc/elements/1.1/
- http://ns.adobe.com/xap/1.0/rights/
- http://creativecommons.org/ns#
- http://ns.adobe.com/xmp/note/
Some of:
- http://ns.adobe.com/xap/1.0/
- http://ns.adobe.com/xap/1.0/mm/
- http://ns.adobe.com/photoshop/1.0/
- http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/
- http://iptc.org/std/Iptc4xmpExt/2008-02-29/
License
GNU General Public License v2.0