@contentauth/c2pa-wasm 0.1.1 → 0.2.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/LICENSE +21 -0
- package/README.md +68 -0
- package/package.json +2 -1
- package/pkg/c2pa.d.ts +22 -10
- package/pkg/c2pa.js +205 -102
- package/pkg/c2pa_bg.wasm +0 -0
- package/pkg/c2pa_bg.wasm.d.ts +8 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# c2pa-wasm
|
|
2
|
+
|
|
3
|
+
The WebAssembly wrapper for [`c2pa-rs`](https://github.com/contentauth/c2pa-rs) that powers `c2pa-web`, built with [wasm-bindgen](https://github.com/wasm-bindgen/wasm-bindgen). While these bindings can be used directly, most users will prefer the convenience of `c2pa-web`.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @contentauth/c2pa-wasm
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Development
|
|
12
|
+
|
|
13
|
+
### Prerequsities
|
|
14
|
+
|
|
15
|
+
Ensure the repo-wide prerequisites [NX](https://nx.dev/getting-started/intro) and [pnpm](https://pnpm.io/) are installed.
|
|
16
|
+
|
|
17
|
+
Then, all of the following prerequisites must be installed before `c2pa-wasm` can be built:
|
|
18
|
+
|
|
19
|
+
#### Rust
|
|
20
|
+
|
|
21
|
+
[Installation instructions](https://www.rust-lang.org/tools/install)
|
|
22
|
+
|
|
23
|
+
Minimum supported Rust version: __1.86.0__.
|
|
24
|
+
|
|
25
|
+
Additionally, the `wasm32-unknown-unknown` target must be installed:
|
|
26
|
+
```sh
|
|
27
|
+
rustup target add wasm32-unknown-unknown
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
#### wasm-bindgen-cli
|
|
32
|
+
|
|
33
|
+
[Documentation](https://wasm-bindgen.github.io/wasm-bindgen/reference/cli)
|
|
34
|
+
```sh
|
|
35
|
+
cargo install wasm-bindgen-cli@0.2.101
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### wasm-opt
|
|
39
|
+
|
|
40
|
+
[Documentation](https://github.com/WebAssembly/binaryen)
|
|
41
|
+
```sh
|
|
42
|
+
cargo install wasm-opt@0.116.1
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### wasm-pack
|
|
46
|
+
|
|
47
|
+
[Documentation](https://rustwasm.github.io/docs/wasm-pack/)
|
|
48
|
+
```sh
|
|
49
|
+
cargo install wasm-pack@0.13.1
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Building
|
|
53
|
+
|
|
54
|
+
To build the library:
|
|
55
|
+
```sh
|
|
56
|
+
nx build c2pa-wasm
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This will execute the commands defined in the [nx-wasm-bindgen executor](https://github.com/contentauth/c2pa-js-v2/blob/main/tools/nx-wasm-bindgen/src/executors/build/executor.ts) to produce the final output in the `pkg/` directory.
|
|
60
|
+
|
|
61
|
+
### Testing
|
|
62
|
+
|
|
63
|
+
The library relies on [`wasm-pack`]((https://rustwasm.github.io/docs/wasm-pack/)) to run its tests. As a general principle, the majority of test coverage will come from `c2pa-web`'s test suite.
|
|
64
|
+
|
|
65
|
+
To run the tests:
|
|
66
|
+
```
|
|
67
|
+
nx test c2pa-wasm
|
|
68
|
+
```
|
package/package.json
CHANGED
package/pkg/c2pa.d.ts
CHANGED
|
@@ -22,14 +22,24 @@ export class WasmReader {
|
|
|
22
22
|
* Attempts to create a new `WasmReader` from an asset format, a `Blob` of the bytes of the initial segment, and a fragment `Blob`.
|
|
23
23
|
*/
|
|
24
24
|
static fromBlobFragment(format: string, init: Blob, fragment: Blob): Promise<WasmReader>;
|
|
25
|
-
/**
|
|
26
|
-
* Returns a JSON representation of the asset's manifest store.
|
|
27
|
-
*/
|
|
28
|
-
json(): string;
|
|
29
25
|
/**
|
|
30
26
|
* Returns the label of the asset's active manifest.
|
|
31
27
|
*/
|
|
32
28
|
activeLabel(): string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the asset's manifest store.
|
|
31
|
+
* NOTE: at the moment, CAWG data is not decoded via this function. Use WasmReader::json() if CAWG is a requirement.
|
|
32
|
+
*/
|
|
33
|
+
manifestStore(): any;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the asset's active manifest.
|
|
36
|
+
* NOTE: at the moment, CAWG data is not decoded via this function. Use WasmReader::json() if CAWG is a requirement.
|
|
37
|
+
*/
|
|
38
|
+
activeManifest(): any;
|
|
39
|
+
/**
|
|
40
|
+
* Returns a JSON representation of the asset's manifest store.
|
|
41
|
+
*/
|
|
42
|
+
json(): string;
|
|
33
43
|
/**
|
|
34
44
|
* Accepts a URI reference to a binary object in the resource store and returns a `js_sys::ArrayBuffer` containing the resource's bytes.
|
|
35
45
|
*/
|
|
@@ -40,14 +50,16 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
40
50
|
|
|
41
51
|
export interface InitOutput {
|
|
42
52
|
readonly memory: WebAssembly.Memory;
|
|
43
|
-
readonly loadSettings: (a: number, b: number) => [number, number];
|
|
44
|
-
readonly run: () => void;
|
|
45
53
|
readonly __wbg_wasmreader_free: (a: number, b: number) => void;
|
|
46
54
|
readonly wasmreader_fromBlob: (a: number, b: number, c: any) => any;
|
|
47
55
|
readonly wasmreader_fromBlobFragment: (a: number, b: number, c: any, d: any) => any;
|
|
48
|
-
readonly wasmreader_json: (a: number) => [number, number];
|
|
49
56
|
readonly wasmreader_activeLabel: (a: number) => [number, number];
|
|
57
|
+
readonly wasmreader_manifestStore: (a: number) => [number, number, number];
|
|
58
|
+
readonly wasmreader_activeManifest: (a: number) => [number, number, number];
|
|
59
|
+
readonly wasmreader_json: (a: number) => [number, number];
|
|
50
60
|
readonly wasmreader_resourceToBuffer: (a: number, b: number, c: number) => [number, number, number];
|
|
61
|
+
readonly loadSettings: (a: number, b: number) => [number, number];
|
|
62
|
+
readonly run: () => void;
|
|
51
63
|
readonly ring_core_0_17_14__bn_mul_mont: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
52
64
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
53
65
|
readonly __externref_table_alloc: () => number;
|
|
@@ -57,9 +69,9 @@ export interface InitOutput {
|
|
|
57
69
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
58
70
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
59
71
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
60
|
-
readonly
|
|
61
|
-
readonly
|
|
62
|
-
readonly
|
|
72
|
+
readonly wasm_bindgen__convert__closures_____invoke__ha5b2289bd84e4451: (a: number, b: number) => void;
|
|
73
|
+
readonly closure1451_externref_shim: (a: number, b: number, c: any) => void;
|
|
74
|
+
readonly closure2451_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
63
75
|
readonly __wbindgen_start: () => void;
|
|
64
76
|
}
|
|
65
77
|
|
package/pkg/c2pa.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
let wasm;
|
|
2
2
|
|
|
3
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
4
|
-
|
|
5
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
6
|
-
|
|
7
3
|
let cachedUint8ArrayMemory0 = null;
|
|
8
4
|
|
|
9
5
|
function getUint8ArrayMemory0() {
|
|
@@ -13,9 +9,25 @@ function getUint8ArrayMemory0() {
|
|
|
13
9
|
return cachedUint8ArrayMemory0;
|
|
14
10
|
}
|
|
15
11
|
|
|
12
|
+
let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
13
|
+
|
|
14
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
15
|
+
|
|
16
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
17
|
+
let numBytesDecoded = 0;
|
|
18
|
+
function decodeText(ptr, len) {
|
|
19
|
+
numBytesDecoded += len;
|
|
20
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
21
|
+
cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
22
|
+
cachedTextDecoder.decode();
|
|
23
|
+
numBytesDecoded = len;
|
|
24
|
+
}
|
|
25
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
26
|
+
}
|
|
27
|
+
|
|
16
28
|
function getStringFromWasm0(ptr, len) {
|
|
17
29
|
ptr = ptr >>> 0;
|
|
18
|
-
return
|
|
30
|
+
return decodeText(ptr, len);
|
|
19
31
|
}
|
|
20
32
|
|
|
21
33
|
function addToExternrefTable0(obj) {
|
|
@@ -33,6 +45,11 @@ function handleError(f, args) {
|
|
|
33
45
|
}
|
|
34
46
|
}
|
|
35
47
|
|
|
48
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
49
|
+
ptr = ptr >>> 0;
|
|
50
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
51
|
+
}
|
|
52
|
+
|
|
36
53
|
let WASM_VECTOR_LEN = 0;
|
|
37
54
|
|
|
38
55
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
@@ -223,16 +240,16 @@ export function run() {
|
|
|
223
240
|
wasm.run();
|
|
224
241
|
}
|
|
225
242
|
|
|
226
|
-
function
|
|
227
|
-
wasm.
|
|
243
|
+
function __wbg_adapter_36(arg0, arg1) {
|
|
244
|
+
wasm.wasm_bindgen__convert__closures_____invoke__ha5b2289bd84e4451(arg0, arg1);
|
|
228
245
|
}
|
|
229
246
|
|
|
230
|
-
function
|
|
231
|
-
wasm.
|
|
247
|
+
function __wbg_adapter_39(arg0, arg1, arg2) {
|
|
248
|
+
wasm.closure1451_externref_shim(arg0, arg1, arg2);
|
|
232
249
|
}
|
|
233
250
|
|
|
234
|
-
function
|
|
235
|
-
wasm.
|
|
251
|
+
function __wbg_adapter_151(arg0, arg1, arg2, arg3) {
|
|
252
|
+
wasm.closure2451_externref_shim(arg0, arg1, arg2, arg3);
|
|
236
253
|
}
|
|
237
254
|
|
|
238
255
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -291,6 +308,43 @@ export class WasmReader {
|
|
|
291
308
|
const ret = wasm.wasmreader_fromBlobFragment(ptr0, len0, init, fragment);
|
|
292
309
|
return ret;
|
|
293
310
|
}
|
|
311
|
+
/**
|
|
312
|
+
* Returns the label of the asset's active manifest.
|
|
313
|
+
* @returns {string | undefined}
|
|
314
|
+
*/
|
|
315
|
+
activeLabel() {
|
|
316
|
+
const ret = wasm.wasmreader_activeLabel(this.__wbg_ptr);
|
|
317
|
+
let v1;
|
|
318
|
+
if (ret[0] !== 0) {
|
|
319
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
320
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
321
|
+
}
|
|
322
|
+
return v1;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Returns the asset's manifest store.
|
|
326
|
+
* NOTE: at the moment, CAWG data is not decoded via this function. Use WasmReader::json() if CAWG is a requirement.
|
|
327
|
+
* @returns {any}
|
|
328
|
+
*/
|
|
329
|
+
manifestStore() {
|
|
330
|
+
const ret = wasm.wasmreader_manifestStore(this.__wbg_ptr);
|
|
331
|
+
if (ret[2]) {
|
|
332
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
333
|
+
}
|
|
334
|
+
return takeFromExternrefTable0(ret[0]);
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Returns the asset's active manifest.
|
|
338
|
+
* NOTE: at the moment, CAWG data is not decoded via this function. Use WasmReader::json() if CAWG is a requirement.
|
|
339
|
+
* @returns {any}
|
|
340
|
+
*/
|
|
341
|
+
activeManifest() {
|
|
342
|
+
const ret = wasm.wasmreader_activeManifest(this.__wbg_ptr);
|
|
343
|
+
if (ret[2]) {
|
|
344
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
345
|
+
}
|
|
346
|
+
return takeFromExternrefTable0(ret[0]);
|
|
347
|
+
}
|
|
294
348
|
/**
|
|
295
349
|
* Returns a JSON representation of the asset's manifest store.
|
|
296
350
|
* @returns {string}
|
|
@@ -307,19 +361,6 @@ export class WasmReader {
|
|
|
307
361
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
308
362
|
}
|
|
309
363
|
}
|
|
310
|
-
/**
|
|
311
|
-
* Returns the label of the asset's active manifest.
|
|
312
|
-
* @returns {string | undefined}
|
|
313
|
-
*/
|
|
314
|
-
activeLabel() {
|
|
315
|
-
const ret = wasm.wasmreader_activeLabel(this.__wbg_ptr);
|
|
316
|
-
let v1;
|
|
317
|
-
if (ret[0] !== 0) {
|
|
318
|
-
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
319
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
320
|
-
}
|
|
321
|
-
return v1;
|
|
322
|
-
}
|
|
323
364
|
/**
|
|
324
365
|
* Accepts a URI reference to a binary object in the resource store and returns a `js_sys::ArrayBuffer` containing the resource's bytes.
|
|
325
366
|
* @param {string} uri
|
|
@@ -336,6 +377,8 @@ export class WasmReader {
|
|
|
336
377
|
}
|
|
337
378
|
}
|
|
338
379
|
|
|
380
|
+
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
381
|
+
|
|
339
382
|
async function __wbg_load(module, imports) {
|
|
340
383
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
341
384
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
@@ -343,7 +386,9 @@ async function __wbg_load(module, imports) {
|
|
|
343
386
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
344
387
|
|
|
345
388
|
} catch (e) {
|
|
346
|
-
|
|
389
|
+
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
390
|
+
|
|
391
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
347
392
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
348
393
|
|
|
349
394
|
} else {
|
|
@@ -370,44 +415,48 @@ async function __wbg_load(module, imports) {
|
|
|
370
415
|
function __wbg_get_imports() {
|
|
371
416
|
const imports = {};
|
|
372
417
|
imports.wbg = {};
|
|
373
|
-
imports.wbg.
|
|
374
|
-
arg0
|
|
418
|
+
imports.wbg.__wbg_Error_0497d5bdba9362e5 = function(arg0, arg1) {
|
|
419
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
420
|
+
return ret;
|
|
375
421
|
};
|
|
376
|
-
imports.wbg.
|
|
422
|
+
imports.wbg.__wbg_abort_18ba44d46e13d7fe = function(arg0) {
|
|
377
423
|
arg0.abort();
|
|
378
424
|
};
|
|
379
|
-
imports.wbg.
|
|
425
|
+
imports.wbg.__wbg_abort_4198a1129c47f21a = function(arg0, arg1) {
|
|
426
|
+
arg0.abort(arg1);
|
|
427
|
+
};
|
|
428
|
+
imports.wbg.__wbg_append_0342728346e47425 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
380
429
|
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
381
430
|
}, arguments) };
|
|
382
|
-
imports.wbg.
|
|
431
|
+
imports.wbg.__wbg_arrayBuffer_d58b858456021d7f = function() { return handleError(function (arg0) {
|
|
383
432
|
const ret = arg0.arrayBuffer();
|
|
384
433
|
return ret;
|
|
385
434
|
}, arguments) };
|
|
386
|
-
imports.wbg.
|
|
435
|
+
imports.wbg.__wbg_buffer_a1a27a0dfa70165d = function(arg0) {
|
|
387
436
|
const ret = arg0.buffer;
|
|
388
437
|
return ret;
|
|
389
438
|
};
|
|
390
|
-
imports.wbg.
|
|
439
|
+
imports.wbg.__wbg_buffer_e495ba54cee589cc = function(arg0) {
|
|
391
440
|
const ret = arg0.buffer;
|
|
392
441
|
return ret;
|
|
393
442
|
};
|
|
394
|
-
imports.wbg.
|
|
443
|
+
imports.wbg.__wbg_byteLength_937f8a52f9697148 = function(arg0) {
|
|
395
444
|
const ret = arg0.byteLength;
|
|
396
445
|
return ret;
|
|
397
446
|
};
|
|
398
|
-
imports.wbg.
|
|
399
|
-
const ret = arg0.call(arg1);
|
|
447
|
+
imports.wbg.__wbg_call_f2db6205e5c51dc8 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
448
|
+
const ret = arg0.call(arg1, arg2);
|
|
400
449
|
return ret;
|
|
401
450
|
}, arguments) };
|
|
402
|
-
imports.wbg.
|
|
403
|
-
const ret = arg0.call(arg1
|
|
451
|
+
imports.wbg.__wbg_call_fbe8be8bf6436ce5 = function() { return handleError(function (arg0, arg1) {
|
|
452
|
+
const ret = arg0.call(arg1);
|
|
404
453
|
return ret;
|
|
405
454
|
}, arguments) };
|
|
406
455
|
imports.wbg.__wbg_clearTimeout_0b53d391c1b94dda = function(arg0) {
|
|
407
456
|
const ret = clearTimeout(arg0);
|
|
408
457
|
return ret;
|
|
409
458
|
};
|
|
410
|
-
imports.wbg.
|
|
459
|
+
imports.wbg.__wbg_done_4d01f352bade43b7 = function(arg0) {
|
|
411
460
|
const ret = arg0.done;
|
|
412
461
|
return ret;
|
|
413
462
|
};
|
|
@@ -426,23 +475,31 @@ function __wbg_get_imports() {
|
|
|
426
475
|
const ret = fetch(arg0);
|
|
427
476
|
return ret;
|
|
428
477
|
};
|
|
429
|
-
imports.wbg.
|
|
478
|
+
imports.wbg.__wbg_fetch_a8e43a4e138dfc93 = function(arg0, arg1) {
|
|
430
479
|
const ret = arg0.fetch(arg1);
|
|
431
480
|
return ret;
|
|
432
481
|
};
|
|
433
|
-
imports.wbg.
|
|
482
|
+
imports.wbg.__wbg_from_12ff8e47307bd4c7 = function(arg0) {
|
|
483
|
+
const ret = Array.from(arg0);
|
|
484
|
+
return ret;
|
|
485
|
+
};
|
|
486
|
+
imports.wbg.__wbg_getTime_2afe67905d873e92 = function(arg0) {
|
|
487
|
+
const ret = arg0.getTime();
|
|
488
|
+
return ret;
|
|
489
|
+
};
|
|
490
|
+
imports.wbg.__wbg_get_92470be87867c2e5 = function() { return handleError(function (arg0, arg1) {
|
|
434
491
|
const ret = Reflect.get(arg0, arg1);
|
|
435
492
|
return ret;
|
|
436
493
|
}, arguments) };
|
|
437
|
-
imports.wbg.
|
|
494
|
+
imports.wbg.__wbg_has_809e438ee9d787a7 = function() { return handleError(function (arg0, arg1) {
|
|
438
495
|
const ret = Reflect.has(arg0, arg1);
|
|
439
496
|
return ret;
|
|
440
497
|
}, arguments) };
|
|
441
|
-
imports.wbg.
|
|
498
|
+
imports.wbg.__wbg_headers_0f0cbdc6290b6780 = function(arg0) {
|
|
442
499
|
const ret = arg0.headers;
|
|
443
500
|
return ret;
|
|
444
501
|
};
|
|
445
|
-
imports.wbg.
|
|
502
|
+
imports.wbg.__wbg_instanceof_Response_e80ce8b7a2b968d2 = function(arg0) {
|
|
446
503
|
let result;
|
|
447
504
|
try {
|
|
448
505
|
result = arg0 instanceof Response;
|
|
@@ -452,30 +509,58 @@ function __wbg_get_imports() {
|
|
|
452
509
|
const ret = result;
|
|
453
510
|
return ret;
|
|
454
511
|
};
|
|
455
|
-
imports.wbg.
|
|
512
|
+
imports.wbg.__wbg_iterator_4068add5b2aef7a6 = function() {
|
|
456
513
|
const ret = Symbol.iterator;
|
|
457
514
|
return ret;
|
|
458
515
|
};
|
|
459
|
-
imports.wbg.
|
|
516
|
+
imports.wbg.__wbg_length_ab6d22b5ead75c72 = function(arg0) {
|
|
460
517
|
const ret = arg0.length;
|
|
461
518
|
return ret;
|
|
462
519
|
};
|
|
463
|
-
imports.wbg.
|
|
520
|
+
imports.wbg.__wbg_new0_97314565408dea38 = function() {
|
|
521
|
+
const ret = new Date();
|
|
522
|
+
return ret;
|
|
523
|
+
};
|
|
524
|
+
imports.wbg.__wbg_new_07b483f72211fd66 = function() {
|
|
525
|
+
const ret = new Object();
|
|
526
|
+
return ret;
|
|
527
|
+
};
|
|
528
|
+
imports.wbg.__wbg_new_186abcfdff244e42 = function() { return handleError(function () {
|
|
529
|
+
const ret = new AbortController();
|
|
530
|
+
return ret;
|
|
531
|
+
}, arguments) };
|
|
532
|
+
imports.wbg.__wbg_new_476169e6d59f23ae = function(arg0, arg1) {
|
|
533
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
534
|
+
return ret;
|
|
535
|
+
};
|
|
536
|
+
imports.wbg.__wbg_new_4796e1cd2eb9ea6d = function() { return handleError(function () {
|
|
464
537
|
const ret = new Headers();
|
|
465
538
|
return ret;
|
|
466
539
|
}, arguments) };
|
|
467
|
-
imports.wbg.
|
|
540
|
+
imports.wbg.__wbg_new_58353953ad2097cc = function() {
|
|
541
|
+
const ret = new Array();
|
|
542
|
+
return ret;
|
|
543
|
+
};
|
|
544
|
+
imports.wbg.__wbg_new_58fdb85a58696862 = function() { return handleError(function () {
|
|
468
545
|
const ret = new FileReaderSync();
|
|
469
546
|
return ret;
|
|
470
547
|
}, arguments) };
|
|
471
|
-
imports.wbg.
|
|
548
|
+
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
549
|
+
const ret = new Error();
|
|
550
|
+
return ret;
|
|
551
|
+
};
|
|
552
|
+
imports.wbg.__wbg_new_a979b4b45bd55c7f = function() {
|
|
553
|
+
const ret = new Map();
|
|
554
|
+
return ret;
|
|
555
|
+
};
|
|
556
|
+
imports.wbg.__wbg_new_e30c39c06edaabf2 = function(arg0, arg1) {
|
|
472
557
|
try {
|
|
473
558
|
var state0 = {a: arg0, b: arg1};
|
|
474
559
|
var cb0 = (arg0, arg1) => {
|
|
475
560
|
const a = state0.a;
|
|
476
561
|
state0.a = 0;
|
|
477
562
|
try {
|
|
478
|
-
return
|
|
563
|
+
return __wbg_adapter_151(a, state0.b, arg0, arg1);
|
|
479
564
|
} finally {
|
|
480
565
|
state0.a = a;
|
|
481
566
|
}
|
|
@@ -486,66 +571,54 @@ function __wbg_get_imports() {
|
|
|
486
571
|
state0.a = state0.b = 0;
|
|
487
572
|
}
|
|
488
573
|
};
|
|
489
|
-
imports.wbg.
|
|
490
|
-
const ret = new Object();
|
|
491
|
-
return ret;
|
|
492
|
-
};
|
|
493
|
-
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
494
|
-
const ret = new Error();
|
|
495
|
-
return ret;
|
|
496
|
-
};
|
|
497
|
-
imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
574
|
+
imports.wbg.__wbg_new_e52b3efaaa774f96 = function(arg0) {
|
|
498
575
|
const ret = new Uint8Array(arg0);
|
|
499
576
|
return ret;
|
|
500
577
|
};
|
|
501
|
-
imports.wbg.
|
|
502
|
-
const ret = new
|
|
578
|
+
imports.wbg.__wbg_newfromslice_7c05ab1297cb2d88 = function(arg0, arg1) {
|
|
579
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
503
580
|
return ret;
|
|
504
581
|
};
|
|
505
|
-
imports.wbg.
|
|
506
|
-
const ret = new AbortController();
|
|
507
|
-
return ret;
|
|
508
|
-
}, arguments) };
|
|
509
|
-
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
582
|
+
imports.wbg.__wbg_newnoargs_ff528e72d35de39a = function(arg0, arg1) {
|
|
510
583
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
511
584
|
return ret;
|
|
512
585
|
};
|
|
513
|
-
imports.wbg.
|
|
586
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_3b01ecda099177e8 = function(arg0, arg1, arg2) {
|
|
514
587
|
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
515
588
|
return ret;
|
|
516
589
|
};
|
|
517
|
-
imports.wbg.
|
|
590
|
+
imports.wbg.__wbg_newwithlength_08f872dc1e3ada2e = function(arg0) {
|
|
518
591
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
519
592
|
return ret;
|
|
520
593
|
};
|
|
521
|
-
imports.wbg.
|
|
594
|
+
imports.wbg.__wbg_newwithstrandinit_f8a9dbe009d6be37 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
522
595
|
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
523
596
|
return ret;
|
|
524
597
|
}, arguments) };
|
|
525
|
-
imports.wbg.
|
|
598
|
+
imports.wbg.__wbg_next_8bb824d217961b5d = function(arg0) {
|
|
526
599
|
const ret = arg0.next;
|
|
527
600
|
return ret;
|
|
528
601
|
};
|
|
529
|
-
imports.wbg.
|
|
602
|
+
imports.wbg.__wbg_next_e2da48d8fff7439a = function() { return handleError(function (arg0) {
|
|
530
603
|
const ret = arg0.next();
|
|
531
604
|
return ret;
|
|
532
605
|
}, arguments) };
|
|
533
|
-
imports.wbg.
|
|
606
|
+
imports.wbg.__wbg_now_eb0821f3bd9f6529 = function() {
|
|
534
607
|
const ret = Date.now();
|
|
535
608
|
return ret;
|
|
536
609
|
};
|
|
537
|
-
imports.wbg.
|
|
610
|
+
imports.wbg.__wbg_queueMicrotask_46c1df247678729f = function(arg0) {
|
|
538
611
|
queueMicrotask(arg0);
|
|
539
612
|
};
|
|
540
|
-
imports.wbg.
|
|
613
|
+
imports.wbg.__wbg_queueMicrotask_8acf3ccb75ed8d11 = function(arg0) {
|
|
541
614
|
const ret = arg0.queueMicrotask;
|
|
542
615
|
return ret;
|
|
543
616
|
};
|
|
544
|
-
imports.wbg.
|
|
617
|
+
imports.wbg.__wbg_readAsArrayBuffer_5af53619afa1b299 = function() { return handleError(function (arg0, arg1) {
|
|
545
618
|
const ret = arg0.readAsArrayBuffer(arg1);
|
|
546
619
|
return ret;
|
|
547
620
|
}, arguments) };
|
|
548
|
-
imports.wbg.
|
|
621
|
+
imports.wbg.__wbg_resolve_0dac8c580ffd4678 = function(arg0) {
|
|
549
622
|
const ret = Promise.resolve(arg0);
|
|
550
623
|
return ret;
|
|
551
624
|
};
|
|
@@ -553,36 +626,46 @@ function __wbg_get_imports() {
|
|
|
553
626
|
const ret = setTimeout(arg0, arg1);
|
|
554
627
|
return ret;
|
|
555
628
|
};
|
|
556
|
-
imports.wbg.
|
|
629
|
+
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
630
|
+
arg0[arg1] = arg2;
|
|
631
|
+
};
|
|
632
|
+
imports.wbg.__wbg_set_7422acbe992d64ab = function(arg0, arg1, arg2) {
|
|
633
|
+
arg0[arg1 >>> 0] = arg2;
|
|
634
|
+
};
|
|
635
|
+
imports.wbg.__wbg_set_d6bdfd275fb8a4ce = function(arg0, arg1, arg2) {
|
|
636
|
+
const ret = arg0.set(arg1, arg2);
|
|
637
|
+
return ret;
|
|
638
|
+
};
|
|
639
|
+
imports.wbg.__wbg_set_fe4e79d1ed3b0e9b = function(arg0, arg1, arg2) {
|
|
557
640
|
arg0.set(arg1, arg2 >>> 0);
|
|
558
641
|
};
|
|
559
|
-
imports.wbg.
|
|
642
|
+
imports.wbg.__wbg_setbody_971ec015fc13d6b4 = function(arg0, arg1) {
|
|
560
643
|
arg0.body = arg1;
|
|
561
644
|
};
|
|
562
|
-
imports.wbg.
|
|
645
|
+
imports.wbg.__wbg_setcredentials_920d91fb5984c94a = function(arg0, arg1) {
|
|
563
646
|
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
564
647
|
};
|
|
565
|
-
imports.wbg.
|
|
648
|
+
imports.wbg.__wbg_setheaders_65a4eb4c0443ae61 = function(arg0, arg1) {
|
|
566
649
|
arg0.headers = arg1;
|
|
567
650
|
};
|
|
568
|
-
imports.wbg.
|
|
651
|
+
imports.wbg.__wbg_setmethod_8ce1be0b4d701b7c = function(arg0, arg1, arg2) {
|
|
569
652
|
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
570
653
|
};
|
|
571
|
-
imports.wbg.
|
|
654
|
+
imports.wbg.__wbg_setmode_bd35f026f55b6247 = function(arg0, arg1) {
|
|
572
655
|
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
573
656
|
};
|
|
574
|
-
imports.wbg.
|
|
657
|
+
imports.wbg.__wbg_setsignal_8e72abfe7ee03c97 = function(arg0, arg1) {
|
|
575
658
|
arg0.signal = arg1;
|
|
576
659
|
};
|
|
577
|
-
imports.wbg.
|
|
660
|
+
imports.wbg.__wbg_signal_b96223519a041faa = function(arg0) {
|
|
578
661
|
const ret = arg0.signal;
|
|
579
662
|
return ret;
|
|
580
663
|
};
|
|
581
|
-
imports.wbg.
|
|
664
|
+
imports.wbg.__wbg_size_e2929e11261f04db = function(arg0) {
|
|
582
665
|
const ret = arg0.size;
|
|
583
666
|
return ret;
|
|
584
667
|
};
|
|
585
|
-
imports.wbg.
|
|
668
|
+
imports.wbg.__wbg_slice_efdd8b335ee00bd0 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
586
669
|
const ret = arg0.slice(arg1, arg2);
|
|
587
670
|
return ret;
|
|
588
671
|
}, arguments) };
|
|
@@ -593,46 +676,46 @@ function __wbg_get_imports() {
|
|
|
593
676
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
594
677
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
595
678
|
};
|
|
596
|
-
imports.wbg.
|
|
679
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_487c52c58d65314d = function() {
|
|
597
680
|
const ret = typeof global === 'undefined' ? null : global;
|
|
598
681
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
599
682
|
};
|
|
600
|
-
imports.wbg.
|
|
683
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_ee9704f328b6b291 = function() {
|
|
601
684
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
602
685
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
603
686
|
};
|
|
604
|
-
imports.wbg.
|
|
687
|
+
imports.wbg.__wbg_static_accessor_SELF_78c9e3071b912620 = function() {
|
|
605
688
|
const ret = typeof self === 'undefined' ? null : self;
|
|
606
689
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
607
690
|
};
|
|
608
|
-
imports.wbg.
|
|
691
|
+
imports.wbg.__wbg_static_accessor_WINDOW_a093d21393777366 = function() {
|
|
609
692
|
const ret = typeof window === 'undefined' ? null : window;
|
|
610
693
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
611
694
|
};
|
|
612
|
-
imports.wbg.
|
|
695
|
+
imports.wbg.__wbg_status_a54682bbe52f9058 = function(arg0) {
|
|
613
696
|
const ret = arg0.status;
|
|
614
697
|
return ret;
|
|
615
698
|
};
|
|
616
|
-
imports.wbg.
|
|
699
|
+
imports.wbg.__wbg_stringify_c242842b97f054cc = function() { return handleError(function (arg0) {
|
|
617
700
|
const ret = JSON.stringify(arg0);
|
|
618
701
|
return ret;
|
|
619
702
|
}, arguments) };
|
|
620
|
-
imports.wbg.
|
|
621
|
-
const ret = arg0.then(arg1);
|
|
703
|
+
imports.wbg.__wbg_then_82ab9fb4080f1707 = function(arg0, arg1, arg2) {
|
|
704
|
+
const ret = arg0.then(arg1, arg2);
|
|
622
705
|
return ret;
|
|
623
706
|
};
|
|
624
|
-
imports.wbg.
|
|
625
|
-
const ret = arg0.then(arg1
|
|
707
|
+
imports.wbg.__wbg_then_db882932c0c714c6 = function(arg0, arg1) {
|
|
708
|
+
const ret = arg0.then(arg1);
|
|
626
709
|
return ret;
|
|
627
710
|
};
|
|
628
|
-
imports.wbg.
|
|
711
|
+
imports.wbg.__wbg_url_e6ed869ea05b7a71 = function(arg0, arg1) {
|
|
629
712
|
const ret = arg1.url;
|
|
630
713
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
631
714
|
const len1 = WASM_VECTOR_LEN;
|
|
632
715
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
633
716
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
634
717
|
};
|
|
635
|
-
imports.wbg.
|
|
718
|
+
imports.wbg.__wbg_value_17b896954e14f896 = function(arg0) {
|
|
636
719
|
const ret = arg0.value;
|
|
637
720
|
return ret;
|
|
638
721
|
};
|
|
@@ -640,6 +723,18 @@ function __wbg_get_imports() {
|
|
|
640
723
|
const ret = WasmReader.__wrap(arg0);
|
|
641
724
|
return ret;
|
|
642
725
|
};
|
|
726
|
+
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
727
|
+
const ret = +arg0;
|
|
728
|
+
return ret;
|
|
729
|
+
};
|
|
730
|
+
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
731
|
+
const ret = arg0;
|
|
732
|
+
return ret;
|
|
733
|
+
};
|
|
734
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
735
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
736
|
+
return ret;
|
|
737
|
+
};
|
|
643
738
|
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
644
739
|
const obj = arg0.original;
|
|
645
740
|
if (obj.cnt-- == 1) {
|
|
@@ -649,12 +744,12 @@ function __wbg_get_imports() {
|
|
|
649
744
|
const ret = false;
|
|
650
745
|
return ret;
|
|
651
746
|
};
|
|
652
|
-
imports.wbg.
|
|
653
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
747
|
+
imports.wbg.__wbindgen_closure_wrapper10869 = function(arg0, arg1, arg2) {
|
|
748
|
+
const ret = makeMutClosure(arg0, arg1, 1447, __wbg_adapter_36);
|
|
654
749
|
return ret;
|
|
655
750
|
};
|
|
656
|
-
imports.wbg.
|
|
657
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
751
|
+
imports.wbg.__wbindgen_closure_wrapper10883 = function(arg0, arg1, arg2) {
|
|
752
|
+
const ret = makeMutClosure(arg0, arg1, 1450, __wbg_adapter_39);
|
|
658
753
|
return ret;
|
|
659
754
|
};
|
|
660
755
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
@@ -683,6 +778,10 @@ function __wbg_get_imports() {
|
|
|
683
778
|
const ret = typeof(val) === 'object' && val !== null;
|
|
684
779
|
return ret;
|
|
685
780
|
};
|
|
781
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
782
|
+
const ret = typeof(arg0) === 'string';
|
|
783
|
+
return ret;
|
|
784
|
+
};
|
|
686
785
|
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
687
786
|
const ret = arg0 === undefined;
|
|
688
787
|
return ret;
|
|
@@ -691,6 +790,10 @@ function __wbg_get_imports() {
|
|
|
691
790
|
const ret = wasm.memory;
|
|
692
791
|
return ret;
|
|
693
792
|
};
|
|
793
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
794
|
+
const ret = arg0;
|
|
795
|
+
return ret;
|
|
796
|
+
};
|
|
694
797
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
695
798
|
const obj = arg1;
|
|
696
799
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -778,4 +881,4 @@ async function __wbg_init(module_or_path) {
|
|
|
778
881
|
|
|
779
882
|
export { initSync };
|
|
780
883
|
export default __wbg_init;
|
|
781
|
-
export const WASM_SRI = "sha512-
|
|
884
|
+
export const WASM_SRI = "sha512-7w/e+kyxISej6Gt6cK/d939I2c82jl9nnydzcwjzuGtJbfA4Vvx3HQUf7dmmapRzvFXZxg5NrSU8tz4v7hBrhw==";
|
package/pkg/c2pa_bg.wasm
CHANGED
|
Binary file
|
package/pkg/c2pa_bg.wasm.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const loadSettings: (a: number, b: number) => [number, number];
|
|
5
|
-
export const run: () => void;
|
|
6
4
|
export const __wbg_wasmreader_free: (a: number, b: number) => void;
|
|
7
5
|
export const wasmreader_fromBlob: (a: number, b: number, c: any) => any;
|
|
8
6
|
export const wasmreader_fromBlobFragment: (a: number, b: number, c: any, d: any) => any;
|
|
9
|
-
export const wasmreader_json: (a: number) => [number, number];
|
|
10
7
|
export const wasmreader_activeLabel: (a: number) => [number, number];
|
|
8
|
+
export const wasmreader_manifestStore: (a: number) => [number, number, number];
|
|
9
|
+
export const wasmreader_activeManifest: (a: number) => [number, number, number];
|
|
10
|
+
export const wasmreader_json: (a: number) => [number, number];
|
|
11
11
|
export const wasmreader_resourceToBuffer: (a: number, b: number, c: number) => [number, number, number];
|
|
12
|
+
export const loadSettings: (a: number, b: number) => [number, number];
|
|
13
|
+
export const run: () => void;
|
|
12
14
|
export const ring_core_0_17_14__bn_mul_mont: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
13
15
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
14
16
|
export const __externref_table_alloc: () => number;
|
|
@@ -18,7 +20,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
18
20
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
19
21
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
20
22
|
export const __externref_table_dealloc: (a: number) => void;
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
23
|
+
export const wasm_bindgen__convert__closures_____invoke__ha5b2289bd84e4451: (a: number, b: number) => void;
|
|
24
|
+
export const closure1451_externref_shim: (a: number, b: number, c: any) => void;
|
|
25
|
+
export const closure2451_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
24
26
|
export const __wbindgen_start: () => void;
|