Viewing manifest data
Initializing the library
The way that you import wasmSrc
and workerSrc
varies depending on the build system you use. For more information, see Quick start.
Viewing manifest data
If the input provided to c2pa.read
has a C2PA manifest and was processed without errors, the returned c2paReadResult
contains a manifestStore
.
The manifestStore
object contains a few properties:
- manifests: An object containing all manifests found in an asset, keyed by UUID.
- activeManifest: A pointer to the latest
manifest
in the manifest store. Effectively the "parent" manifest, this is the likely starting point when inspecting an asset's C2PA data. - validationStatus: A list of any validation errors the library generated when processing an asset. See Validation for more information.
Manifest
objects contain properties pertaining to an asset's provenance, along with convenient interfaces for accessing assertion data and generating a thumbnail. The example in this sandbox demonstrates a basic workflow: reading a sample image, checking for the presence of a manifest store, and displaying the data in the active manifest:
The source code for this example is in the c2pa-js-examples repo.
This example also features the use of the selectProducer
selector function. See Selectors for more information.