forked from external-repos/squoosh
Move to makefile for AVIF
This commit is contained in:
11
codecs/avif/enc/example.js
Normal file
11
codecs/avif/enc/example.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const fs = require("fs");
|
||||
const avifEnc = require("./avif_enc.js")(fs.readFileSync("./avif_enc.wasm"));
|
||||
|
||||
avifEnc.onRuntimeInitialized = () => {
|
||||
const avif = avifEnc.encode(
|
||||
new Uint8Array([255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255]),
|
||||
3,
|
||||
1
|
||||
);
|
||||
fs.writeFileSync("lol.avif", avif);
|
||||
};
|
||||
Reference in New Issue
Block a user