merfix 0.1.70 → 0.1.72
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/merfix.d.ts +56 -47
- package/merfix.js +211 -220
- package/merfix_bg.wasm +0 -0
- package/package.json +1 -1
package/merfix.d.ts
CHANGED
|
@@ -1,65 +1,74 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export class ExifRemovalResult {
|
|
5
|
+
private constructor();
|
|
6
|
+
free(): void;
|
|
7
|
+
[Symbol.dispose](): void;
|
|
8
|
+
get_data(): Uint8Array | undefined;
|
|
9
|
+
get_error(): string | undefined;
|
|
10
|
+
is_error(): boolean;
|
|
11
|
+
status(): string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export enum ExifRemovalStatus {
|
|
15
|
+
Success = 0,
|
|
16
|
+
Error = 1,
|
|
17
|
+
}
|
|
18
|
+
|
|
3
19
|
export function detect_image_extension(data: Uint8Array): string | undefined;
|
|
4
|
-
|
|
20
|
+
|
|
5
21
|
export function detect_image_mime_type(data: Uint8Array): string | undefined;
|
|
22
|
+
|
|
23
|
+
export function remove_exif(input: Uint8Array, extension: string): ExifRemovalResult;
|
|
24
|
+
|
|
25
|
+
export function supported_extensions(): any[];
|
|
26
|
+
|
|
6
27
|
export function supported_mime_types(): any[];
|
|
28
|
+
|
|
7
29
|
export function version(): string;
|
|
8
|
-
export function remove_exif(input: Uint8Array, extension: string): ExifRemovalResult;
|
|
9
|
-
export enum ExifRemovalStatus {
|
|
10
|
-
Success = 0,
|
|
11
|
-
Error = 1,
|
|
12
|
-
}
|
|
13
|
-
export class ExifRemovalResult {
|
|
14
|
-
private constructor();
|
|
15
|
-
free(): void;
|
|
16
|
-
[Symbol.dispose](): void;
|
|
17
|
-
status(): string;
|
|
18
|
-
get_data(): Uint8Array | undefined;
|
|
19
|
-
is_error(): boolean;
|
|
20
|
-
get_error(): string | undefined;
|
|
21
|
-
}
|
|
22
30
|
|
|
23
31
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
24
32
|
|
|
25
33
|
export interface InitOutput {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
readonly memory: WebAssembly.Memory;
|
|
35
|
+
readonly __wbg_exifremovalresult_free: (a: number, b: number) => void;
|
|
36
|
+
readonly detect_image_extension: (a: number, b: number) => [number, number];
|
|
37
|
+
readonly detect_image_mime_type: (a: number, b: number) => [number, number];
|
|
38
|
+
readonly exifremovalresult_get_data: (a: number) => [number, number];
|
|
39
|
+
readonly exifremovalresult_get_error: (a: number) => [number, number];
|
|
40
|
+
readonly exifremovalresult_is_error: (a: number) => number;
|
|
41
|
+
readonly exifremovalresult_status: (a: number) => [number, number];
|
|
42
|
+
readonly remove_exif: (a: number, b: number, c: number, d: number) => number;
|
|
43
|
+
readonly supported_extensions: () => [number, number];
|
|
44
|
+
readonly supported_mime_types: () => [number, number];
|
|
45
|
+
readonly version: () => [number, number];
|
|
46
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
47
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
48
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
49
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
50
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
51
|
+
readonly __wbindgen_start: () => void;
|
|
44
52
|
}
|
|
45
53
|
|
|
46
54
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
55
|
+
|
|
47
56
|
/**
|
|
48
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
49
|
-
* a precompiled `WebAssembly.Module`.
|
|
50
|
-
*
|
|
51
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
52
|
-
*
|
|
53
|
-
* @returns {InitOutput}
|
|
54
|
-
*/
|
|
57
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
58
|
+
* a precompiled `WebAssembly.Module`.
|
|
59
|
+
*
|
|
60
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
61
|
+
*
|
|
62
|
+
* @returns {InitOutput}
|
|
63
|
+
*/
|
|
55
64
|
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
56
65
|
|
|
57
66
|
/**
|
|
58
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
59
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
60
|
-
*
|
|
61
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
62
|
-
*
|
|
63
|
-
* @returns {Promise<InitOutput>}
|
|
64
|
-
*/
|
|
67
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
68
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
69
|
+
*
|
|
70
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
71
|
+
*
|
|
72
|
+
* @returns {Promise<InitOutput>}
|
|
73
|
+
*/
|
|
65
74
|
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/merfix.js
CHANGED
|
@@ -1,48 +1,80 @@
|
|
|
1
|
-
|
|
1
|
+
/* @ts-self-types="./merfix.d.ts" */
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export class ExifRemovalResult {
|
|
4
|
+
static __wrap(ptr) {
|
|
5
|
+
ptr = ptr >>> 0;
|
|
6
|
+
const obj = Object.create(ExifRemovalResult.prototype);
|
|
7
|
+
obj.__wbg_ptr = ptr;
|
|
8
|
+
ExifRemovalResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
9
|
+
return obj;
|
|
8
10
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
__destroy_into_raw() {
|
|
12
|
+
const ptr = this.__wbg_ptr;
|
|
13
|
+
this.__wbg_ptr = 0;
|
|
14
|
+
ExifRemovalResultFinalization.unregister(this);
|
|
15
|
+
return ptr;
|
|
16
|
+
}
|
|
17
|
+
free() {
|
|
18
|
+
const ptr = this.__destroy_into_raw();
|
|
19
|
+
wasm.__wbg_exifremovalresult_free(ptr, 0);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @returns {Uint8Array | undefined}
|
|
23
|
+
*/
|
|
24
|
+
get_data() {
|
|
25
|
+
const ret = wasm.exifremovalresult_get_data(this.__wbg_ptr);
|
|
26
|
+
let v1;
|
|
27
|
+
if (ret[0] !== 0) {
|
|
28
|
+
v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
29
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
30
|
+
}
|
|
31
|
+
return v1;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @returns {string | undefined}
|
|
35
|
+
*/
|
|
36
|
+
get_error() {
|
|
37
|
+
const ret = wasm.exifremovalresult_get_error(this.__wbg_ptr);
|
|
38
|
+
let v1;
|
|
39
|
+
if (ret[0] !== 0) {
|
|
40
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
41
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
42
|
+
}
|
|
43
|
+
return v1;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @returns {boolean}
|
|
47
|
+
*/
|
|
48
|
+
is_error() {
|
|
49
|
+
const ret = wasm.exifremovalresult_is_error(this.__wbg_ptr);
|
|
50
|
+
return ret !== 0;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @returns {string}
|
|
54
|
+
*/
|
|
55
|
+
status() {
|
|
56
|
+
let deferred1_0;
|
|
57
|
+
let deferred1_1;
|
|
58
|
+
try {
|
|
59
|
+
const ret = wasm.exifremovalresult_status(this.__wbg_ptr);
|
|
60
|
+
deferred1_0 = ret[0];
|
|
61
|
+
deferred1_1 = ret[1];
|
|
62
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
63
|
+
} finally {
|
|
64
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
65
|
+
}
|
|
24
66
|
}
|
|
25
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function getStringFromWasm0(ptr, len) {
|
|
29
|
-
ptr = ptr >>> 0;
|
|
30
|
-
return decodeText(ptr, len);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
34
|
-
ptr = ptr >>> 0;
|
|
35
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
36
67
|
}
|
|
68
|
+
if (Symbol.dispose) ExifRemovalResult.prototype[Symbol.dispose] = ExifRemovalResult.prototype.free;
|
|
37
69
|
|
|
38
|
-
|
|
70
|
+
/**
|
|
71
|
+
* @enum {0 | 1}
|
|
72
|
+
*/
|
|
73
|
+
export const ExifRemovalStatus = Object.freeze({
|
|
74
|
+
Success: 0, "0": "Success",
|
|
75
|
+
Error: 1, "1": "Error",
|
|
76
|
+
});
|
|
39
77
|
|
|
40
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
41
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
42
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
43
|
-
WASM_VECTOR_LEN = arg.length;
|
|
44
|
-
return ptr;
|
|
45
|
-
}
|
|
46
78
|
/**
|
|
47
79
|
* @param {Uint8Array} data
|
|
48
80
|
* @returns {string | undefined}
|
|
@@ -59,35 +91,6 @@ export function detect_image_extension(data) {
|
|
|
59
91
|
return v2;
|
|
60
92
|
}
|
|
61
93
|
|
|
62
|
-
let cachedDataViewMemory0 = null;
|
|
63
|
-
|
|
64
|
-
function getDataViewMemory0() {
|
|
65
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
66
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
67
|
-
}
|
|
68
|
-
return cachedDataViewMemory0;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
72
|
-
ptr = ptr >>> 0;
|
|
73
|
-
const mem = getDataViewMemory0();
|
|
74
|
-
const result = [];
|
|
75
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
76
|
-
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
77
|
-
}
|
|
78
|
-
wasm.__externref_drop_slice(ptr, len);
|
|
79
|
-
return result;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* @returns {any[]}
|
|
83
|
-
*/
|
|
84
|
-
export function supported_extensions() {
|
|
85
|
-
const ret = wasm.supported_extensions();
|
|
86
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
87
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
88
|
-
return v1;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
94
|
/**
|
|
92
95
|
* @param {Uint8Array} data
|
|
93
96
|
* @returns {string | undefined}
|
|
@@ -104,6 +107,30 @@ export function detect_image_mime_type(data) {
|
|
|
104
107
|
return v2;
|
|
105
108
|
}
|
|
106
109
|
|
|
110
|
+
/**
|
|
111
|
+
* @param {Uint8Array} input
|
|
112
|
+
* @param {string} extension
|
|
113
|
+
* @returns {ExifRemovalResult}
|
|
114
|
+
*/
|
|
115
|
+
export function remove_exif(input, extension) {
|
|
116
|
+
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
|
|
117
|
+
const len0 = WASM_VECTOR_LEN;
|
|
118
|
+
const ptr1 = passStringToWasm0(extension, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
119
|
+
const len1 = WASM_VECTOR_LEN;
|
|
120
|
+
const ret = wasm.remove_exif(ptr0, len0, ptr1, len1);
|
|
121
|
+
return ExifRemovalResult.__wrap(ret);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @returns {any[]}
|
|
126
|
+
*/
|
|
127
|
+
export function supported_extensions() {
|
|
128
|
+
const ret = wasm.supported_extensions();
|
|
129
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
130
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
131
|
+
return v1;
|
|
132
|
+
}
|
|
133
|
+
|
|
107
134
|
/**
|
|
108
135
|
* @returns {any[]}
|
|
109
136
|
*/
|
|
@@ -130,21 +157,82 @@ export function version() {
|
|
|
130
157
|
}
|
|
131
158
|
}
|
|
132
159
|
|
|
133
|
-
|
|
160
|
+
function __wbg_get_imports() {
|
|
161
|
+
const import0 = {
|
|
162
|
+
__proto__: null,
|
|
163
|
+
__wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
|
|
164
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
165
|
+
},
|
|
166
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
167
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
168
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
169
|
+
return ret;
|
|
170
|
+
},
|
|
171
|
+
__wbindgen_init_externref_table: function() {
|
|
172
|
+
const table = wasm.__wbindgen_externrefs;
|
|
173
|
+
const offset = table.grow(4);
|
|
174
|
+
table.set(0, undefined);
|
|
175
|
+
table.set(offset + 0, undefined);
|
|
176
|
+
table.set(offset + 1, null);
|
|
177
|
+
table.set(offset + 2, true);
|
|
178
|
+
table.set(offset + 3, false);
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
return {
|
|
182
|
+
__proto__: null,
|
|
183
|
+
"./merfix_bg.js": import0,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
134
186
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
187
|
+
const ExifRemovalResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
188
|
+
? { register: () => {}, unregister: () => {} }
|
|
189
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_exifremovalresult_free(ptr >>> 0, 1));
|
|
190
|
+
|
|
191
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
192
|
+
ptr = ptr >>> 0;
|
|
193
|
+
const mem = getDataViewMemory0();
|
|
194
|
+
const result = [];
|
|
195
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
196
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
143
197
|
}
|
|
198
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
199
|
+
return result;
|
|
144
200
|
}
|
|
145
201
|
|
|
146
|
-
function
|
|
202
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
203
|
+
ptr = ptr >>> 0;
|
|
204
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
let cachedDataViewMemory0 = null;
|
|
208
|
+
function getDataViewMemory0() {
|
|
209
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
210
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
211
|
+
}
|
|
212
|
+
return cachedDataViewMemory0;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function getStringFromWasm0(ptr, len) {
|
|
216
|
+
ptr = ptr >>> 0;
|
|
217
|
+
return decodeText(ptr, len);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
let cachedUint8ArrayMemory0 = null;
|
|
221
|
+
function getUint8ArrayMemory0() {
|
|
222
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
223
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
224
|
+
}
|
|
225
|
+
return cachedUint8ArrayMemory0;
|
|
226
|
+
}
|
|
147
227
|
|
|
228
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
229
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
230
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
231
|
+
WASM_VECTOR_LEN = arg.length;
|
|
232
|
+
return ptr;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
148
236
|
if (realloc === undefined) {
|
|
149
237
|
const buf = cachedTextEncoder.encode(arg);
|
|
150
238
|
const ptr = malloc(buf.length, 1) >>> 0;
|
|
@@ -165,7 +253,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
165
253
|
if (code > 0x7F) break;
|
|
166
254
|
mem[ptr + offset] = code;
|
|
167
255
|
}
|
|
168
|
-
|
|
169
256
|
if (offset !== len) {
|
|
170
257
|
if (offset !== 0) {
|
|
171
258
|
arg = arg.slice(offset);
|
|
@@ -181,178 +268,86 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
181
268
|
WASM_VECTOR_LEN = offset;
|
|
182
269
|
return ptr;
|
|
183
270
|
}
|
|
184
|
-
/**
|
|
185
|
-
* @param {Uint8Array} input
|
|
186
|
-
* @param {string} extension
|
|
187
|
-
* @returns {ExifRemovalResult}
|
|
188
|
-
*/
|
|
189
|
-
export function remove_exif(input, extension) {
|
|
190
|
-
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
|
|
191
|
-
const len0 = WASM_VECTOR_LEN;
|
|
192
|
-
const ptr1 = passStringToWasm0(extension, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
193
|
-
const len1 = WASM_VECTOR_LEN;
|
|
194
|
-
const ret = wasm.remove_exif(ptr0, len0, ptr1, len1);
|
|
195
|
-
return ExifRemovalResult.__wrap(ret);
|
|
196
|
-
}
|
|
197
271
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_exifremovalresult_free(ptr >>> 0, 1));
|
|
209
|
-
|
|
210
|
-
export class ExifRemovalResult {
|
|
211
|
-
|
|
212
|
-
static __wrap(ptr) {
|
|
213
|
-
ptr = ptr >>> 0;
|
|
214
|
-
const obj = Object.create(ExifRemovalResult.prototype);
|
|
215
|
-
obj.__wbg_ptr = ptr;
|
|
216
|
-
ExifRemovalResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
217
|
-
return obj;
|
|
272
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
273
|
+
cachedTextDecoder.decode();
|
|
274
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
275
|
+
let numBytesDecoded = 0;
|
|
276
|
+
function decodeText(ptr, len) {
|
|
277
|
+
numBytesDecoded += len;
|
|
278
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
279
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
280
|
+
cachedTextDecoder.decode();
|
|
281
|
+
numBytesDecoded = len;
|
|
218
282
|
}
|
|
283
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
284
|
+
}
|
|
219
285
|
|
|
220
|
-
|
|
221
|
-
const ptr = this.__wbg_ptr;
|
|
222
|
-
this.__wbg_ptr = 0;
|
|
223
|
-
ExifRemovalResultFinalization.unregister(this);
|
|
224
|
-
return ptr;
|
|
225
|
-
}
|
|
286
|
+
const cachedTextEncoder = new TextEncoder();
|
|
226
287
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
let deferred1_1;
|
|
237
|
-
try {
|
|
238
|
-
const ret = wasm.exifremovalresult_status(this.__wbg_ptr);
|
|
239
|
-
deferred1_0 = ret[0];
|
|
240
|
-
deferred1_1 = ret[1];
|
|
241
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
242
|
-
} finally {
|
|
243
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* @returns {Uint8Array | undefined}
|
|
248
|
-
*/
|
|
249
|
-
get_data() {
|
|
250
|
-
const ret = wasm.exifremovalresult_get_data(this.__wbg_ptr);
|
|
251
|
-
let v1;
|
|
252
|
-
if (ret[0] !== 0) {
|
|
253
|
-
v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
254
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
255
|
-
}
|
|
256
|
-
return v1;
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* @returns {boolean}
|
|
260
|
-
*/
|
|
261
|
-
is_error() {
|
|
262
|
-
const ret = wasm.exifremovalresult_is_error(this.__wbg_ptr);
|
|
263
|
-
return ret !== 0;
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* @returns {string | undefined}
|
|
267
|
-
*/
|
|
268
|
-
get_error() {
|
|
269
|
-
const ret = wasm.exifremovalresult_get_error(this.__wbg_ptr);
|
|
270
|
-
let v1;
|
|
271
|
-
if (ret[0] !== 0) {
|
|
272
|
-
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
273
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
274
|
-
}
|
|
275
|
-
return v1;
|
|
276
|
-
}
|
|
288
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
289
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
290
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
291
|
+
view.set(buf);
|
|
292
|
+
return {
|
|
293
|
+
read: arg.length,
|
|
294
|
+
written: buf.length
|
|
295
|
+
};
|
|
296
|
+
};
|
|
277
297
|
}
|
|
278
|
-
if (Symbol.dispose) ExifRemovalResult.prototype[Symbol.dispose] = ExifRemovalResult.prototype.free;
|
|
279
298
|
|
|
280
|
-
|
|
299
|
+
let WASM_VECTOR_LEN = 0;
|
|
300
|
+
|
|
301
|
+
let wasmModule, wasm;
|
|
302
|
+
function __wbg_finalize_init(instance, module) {
|
|
303
|
+
wasm = instance.exports;
|
|
304
|
+
wasmModule = module;
|
|
305
|
+
cachedDataViewMemory0 = null;
|
|
306
|
+
cachedUint8ArrayMemory0 = null;
|
|
307
|
+
wasm.__wbindgen_start();
|
|
308
|
+
return wasm;
|
|
309
|
+
}
|
|
281
310
|
|
|
282
311
|
async function __wbg_load(module, imports) {
|
|
283
312
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
284
313
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
285
314
|
try {
|
|
286
315
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
287
|
-
|
|
288
316
|
} catch (e) {
|
|
289
|
-
const validResponse = module.ok &&
|
|
317
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
290
318
|
|
|
291
319
|
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
292
320
|
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);
|
|
293
321
|
|
|
294
|
-
} else {
|
|
295
|
-
throw e;
|
|
296
|
-
}
|
|
322
|
+
} else { throw e; }
|
|
297
323
|
}
|
|
298
324
|
}
|
|
299
325
|
|
|
300
326
|
const bytes = await module.arrayBuffer();
|
|
301
327
|
return await WebAssembly.instantiate(bytes, imports);
|
|
302
|
-
|
|
303
328
|
} else {
|
|
304
329
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
305
330
|
|
|
306
331
|
if (instance instanceof WebAssembly.Instance) {
|
|
307
332
|
return { instance, module };
|
|
308
|
-
|
|
309
333
|
} else {
|
|
310
334
|
return instance;
|
|
311
335
|
}
|
|
312
336
|
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
function __wbg_get_imports() {
|
|
316
|
-
const imports = {};
|
|
317
|
-
imports.wbg = {};
|
|
318
|
-
imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
319
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
320
|
-
};
|
|
321
|
-
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
322
|
-
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
323
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
324
|
-
return ret;
|
|
325
|
-
};
|
|
326
|
-
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
327
|
-
const table = wasm.__wbindgen_externrefs;
|
|
328
|
-
const offset = table.grow(4);
|
|
329
|
-
table.set(0, undefined);
|
|
330
|
-
table.set(offset + 0, undefined);
|
|
331
|
-
table.set(offset + 1, null);
|
|
332
|
-
table.set(offset + 2, true);
|
|
333
|
-
table.set(offset + 3, false);
|
|
334
|
-
;
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
return imports;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function __wbg_finalize_init(instance, module) {
|
|
341
|
-
wasm = instance.exports;
|
|
342
|
-
__wbg_init.__wbindgen_wasm_module = module;
|
|
343
|
-
cachedDataViewMemory0 = null;
|
|
344
|
-
cachedUint8ArrayMemory0 = null;
|
|
345
337
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
338
|
+
function expectedResponseType(type) {
|
|
339
|
+
switch (type) {
|
|
340
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
341
|
+
}
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
349
344
|
}
|
|
350
345
|
|
|
351
346
|
function initSync(module) {
|
|
352
347
|
if (wasm !== undefined) return wasm;
|
|
353
348
|
|
|
354
349
|
|
|
355
|
-
if (
|
|
350
|
+
if (module !== undefined) {
|
|
356
351
|
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
357
352
|
({module} = module)
|
|
358
353
|
} else {
|
|
@@ -361,13 +356,10 @@ function initSync(module) {
|
|
|
361
356
|
}
|
|
362
357
|
|
|
363
358
|
const imports = __wbg_get_imports();
|
|
364
|
-
|
|
365
359
|
if (!(module instanceof WebAssembly.Module)) {
|
|
366
360
|
module = new WebAssembly.Module(module);
|
|
367
361
|
}
|
|
368
|
-
|
|
369
362
|
const instance = new WebAssembly.Instance(module, imports);
|
|
370
|
-
|
|
371
363
|
return __wbg_finalize_init(instance, module);
|
|
372
364
|
}
|
|
373
365
|
|
|
@@ -375,7 +367,7 @@ async function __wbg_init(module_or_path) {
|
|
|
375
367
|
if (wasm !== undefined) return wasm;
|
|
376
368
|
|
|
377
369
|
|
|
378
|
-
if (
|
|
370
|
+
if (module_or_path !== undefined) {
|
|
379
371
|
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
380
372
|
({module_or_path} = module_or_path)
|
|
381
373
|
} else {
|
|
@@ -383,7 +375,7 @@ async function __wbg_init(module_or_path) {
|
|
|
383
375
|
}
|
|
384
376
|
}
|
|
385
377
|
|
|
386
|
-
if (
|
|
378
|
+
if (module_or_path === undefined) {
|
|
387
379
|
module_or_path = new URL('merfix_bg.wasm', import.meta.url);
|
|
388
380
|
}
|
|
389
381
|
const imports = __wbg_get_imports();
|
|
@@ -397,5 +389,4 @@ async function __wbg_init(module_or_path) {
|
|
|
397
389
|
return __wbg_finalize_init(instance, module);
|
|
398
390
|
}
|
|
399
391
|
|
|
400
|
-
export { initSync };
|
|
401
|
-
export default __wbg_init;
|
|
392
|
+
export { initSync, __wbg_init as default };
|
package/merfix_bg.wasm
CHANGED
|
Binary file
|