wikimedia/xmp-reader

用于包含与图像相关属性的XMP数据的读取器

0.9.1 2022-11-17 03:30 UTC

This package is auto-updated.

Last update: 2024-09-12 06:09:50 UTC


README

用PHP编写的用于包含与图像相关属性的XMP数据的读取器。

用法

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();

解析结果以3个潜在组数组的格式返回,这些组按照元数据工作组指南的优先级指示。 http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf

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

支持的XMP

以下大多数元数据集都得到支持

一些

许可证

GNU通用公共许可证v2.0