Add test to JXL decoder

This commit is contained in:
Surma
2020-02-06 13:59:53 -08:00
committed by Ingvar Stepanyan
parent de1eb76226
commit 3697635bae
6 changed files with 44 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
<!doctype html>
<script src='avif_dec.js'></script>
<script src='jxl_dec.js'></script>
<script>
const Module = avif_dec();
const Module = jxl_dec();
async function loadFile(src) {
const resp = await fetch(src);
@@ -9,7 +9,7 @@
}
Module.onRuntimeInitialized = async _ => {
const image = await loadFile('../example.avif');
const image = await loadFile('../example.jxl');
const result = Module.decode(image);
console.log(result.width, result.height, result.buffer);
const imageData = new ImageData(new Uint8ClampedArray(result.buffer), result.width, result.height);