forked from external-repos/squoosh
@@ -27,6 +27,7 @@
|
||||
get_result_pointer: Module.cwrap('get_result_pointer', 'number', []),
|
||||
get_result_size: Module.cwrap('get_result_size', 'number', []),
|
||||
};
|
||||
console.log('Version:', api.version().toString(16));
|
||||
const image = await loadImage('../example.png');
|
||||
const p = api.create_buffer(image.width, image.height);
|
||||
Module.HEAP8.set(image.data, p);
|
||||
|
||||
2
codecs/webp_dec/.gitignore
vendored
2
codecs/webp_dec/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
/*.wasm
|
||||
/*.js
|
||||
@@ -19,6 +19,7 @@
|
||||
get_result_width: Module.cwrap('get_result_width', 'number', []),
|
||||
get_result_height: Module.cwrap('get_result_height', 'number', []),
|
||||
};
|
||||
console.log('Version:', api.version().toString(16));
|
||||
const image = await loadFile('../example.webp');
|
||||
const p = api.create_buffer(image.byteLength);
|
||||
Module.HEAP8.set(new Uint8Array(image), p);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"build": "docker run --rm -v $(pwd):/src trzeci/emscripten emcc -O3 -s WASM=1 -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"cwrap\"]' -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s 'EXPORT_NAME=\"webp_dec\"' -I node_modules/libwebp -o ./webp_dec.js webp_dec.c node_modules/libwebp/src/{dec,dsp,demux,enc,mux,utils}/*.c"
|
||||
},
|
||||
"napa": {
|
||||
"libwebp": "webmproject/libwebp#v0.6.1"
|
||||
"libwebp": "webmproject/libwebp#v1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"napa": "^3.0.0"
|
||||
|
||||
17
codecs/webp_dec/webp_dec.js
Normal file
17
codecs/webp_dec/webp_dec.js
Normal file
File diff suppressed because one or more lines are too long
BIN
codecs/webp_dec/webp_dec.wasm
Normal file
BIN
codecs/webp_dec/webp_dec.wasm
Normal file
Binary file not shown.
@@ -27,6 +27,7 @@
|
||||
get_result_pointer: Module.cwrap('get_result_pointer', 'number', []),
|
||||
get_result_size: Module.cwrap('get_result_size', 'number', []),
|
||||
};
|
||||
console.log('Version:', api.version().toString(16));
|
||||
const image = await loadImage('../example.png');
|
||||
const p = api.create_buffer(image.width, image.height);
|
||||
Module.HEAP8.set(image.data, p);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"build": "docker run --rm -v $(pwd):/src trzeci/emscripten emcc -O3 -s WASM=1 -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"cwrap\"]' -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s 'EXPORT_NAME=\"webp_enc\"' -I node_modules/libwebp -o ./webp_enc.js webp_enc.c node_modules/libwebp/src/{dec,dsp,demux,enc,mux,utils}/*.c"
|
||||
},
|
||||
"napa": {
|
||||
"libwebp": "webmproject/libwebp#v0.6.1"
|
||||
"libwebp": "webmproject/libwebp#v1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"napa": "^3.0.0"
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Reference in New Issue
Block a user