@svta/cml-c2pa 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/index.d.ts +260 -236
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +734 -368
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Supported C2PA segment validation methods:
|
|
|
15
15
|
npm i @svta/cml-c2pa
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
> **Note:** `@svta/cml-iso-bmff
|
|
18
|
+
> **Note:** `@svta/cml-iso-bmff` and `@svta/cml-utils` are peer dependencies. Most package managers install them automatically, but you may need to add them explicitly.
|
|
19
19
|
|
|
20
20
|
> **Note:** This library uses the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) (`crypto.subtle`) to verify COSE signatures and compute BMFF hashes. In Node.js 20+, `crypto.subtle` is available globally. In browsers, it requires a [secure context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts) (HTTPS or `localhost`).
|
|
21
21
|
|
|
@@ -55,6 +55,10 @@ import { validateC2paInitSegment, validateC2paSegment } from '@svta/cml-c2pa'
|
|
|
55
55
|
async function validateVsiSegment(initUrl: string, segmentUrl: string): Promise<void> {
|
|
56
56
|
const initResponse = await fetch(initUrl)
|
|
57
57
|
const init = await validateC2paInitSegment(new Uint8Array(await initResponse.arrayBuffer()))
|
|
58
|
+
if (!init.isValid) {
|
|
59
|
+
console.error(init.errorCodes)
|
|
60
|
+
return
|
|
61
|
+
}
|
|
58
62
|
|
|
59
63
|
const segmentResponse = await fetch(segmentUrl)
|
|
60
64
|
const segmentBytes = new Uint8Array(await segmentResponse.arrayBuffer())
|