Reader for XMP data containing properties relevant to images

0.9.1 2022-11-17 03:30 UTC

This package is auto-updated.

Last update: 2024-05-06 04:16:07 UTC


Reader for XMP data containing properties relevant to images, written in PHP.


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.

	'xmp-exif' => [],
	'xmp-general' => [],
	'xmp-deprecated' => [],

Supported XMP

Most of the following metadata sets are supported

Some of:


GNU General Public License v2.0