KhronosGroup / KTX-Specification

KTX file format source
Other
69 stars 12 forks source link

Support XMP metadata #212

Open lexaknyazev opened 5 months ago

lexaknyazev commented 5 months ago

The current key-value storage is suitable for KTX-specific metadata entries but using it for storing generic information such as copyright and authorship is not practical. Common image formats (such as PNG and JPEG) support embedded XMP blocks that can provide interoperable metadata for integration with other systems.

An XMP block is either an XML or a JSON-LD document as defined in ISO 16684-1 or ISO 16684-3 respectively. Since it's text-based and may be quite verbose, zlib or zstd compression may be reasonable.

MarkCallow commented 5 months ago

Why do you say current key-value storage is not practical? Generically values can be nul-terminated utf-8 strings. Are XML and JSON-LD not utf-8?

Specifically what do you want to add to the spec?

lexaknyazev commented 5 months ago

Here's the set of XMP fields used for attribution: https://developer.adobe.com/xmp/docs/XMPNamespaces/dc/. It's not practical to define mappings (sometimes non-trivial) from them to individual KTX* metadata keys.

The proposal is to add only one new metadata key, e.g., KTXxmp and its value would be a standard XMP payload. Tools then would be able to copy XMP data from PNG (and other sources) to KTX without much efforts.

MarkCallow commented 1 month ago

@lexaknyazev I see no problem adding KTXxmp. Please provide a PR.