Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
@saschazar/wasm-avif
Advanced tools
A dependency-free AVIF decoder written in WebAssembly
It decodes AVIF-encoded image data in a Uint8Array
containing raw RGB pixels.
yarn add @saschazar/wasm-avif
or
npm install --save @saschazar/wasm-avif
It supports usage in the browser, in a Web Worker and of course Node.js.
// Node.js
import wasm_avif from '@saschazar/wasm-avif'
// Web Worker - see: https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts
importScripts('wasm_webp.js')
// -------- Browser/Web Worker/Node.js code below --------
// Load encoded AVIF image data in Uint8Array
const array = new Uint8Array(['some', 'encoded', 'AVIF', 'image', 'data'])
let result
// Initialize the WebAssembly Module
const avifModule = wasm_avif({
onRuntimeInitialized() {
result = avifModule.decode(array, array.length) // decode image data and return a new Uint8Array
avifModule.free() // clean up memory after encoding is done
}
})
The main backbone of the project is the libavif library.
Currently only AVIF decoding using dav1d is enabled. Furthermore, only 8-bit images are getting decoded reliably.
Concerning the encoding functionality, a few trials have been made towards using the libaom and rav1e encoder, but none of them succeeded yet.
The latest progress is visible as commented-out code in the build.sh and main.cpp.
This module uses the AOMediaCodec/libavif's source code and most of the code is written according to the examples provided in that repository.
Licensed under the MIT license.
Copyright ©️ 2020 Sascha Zarhuber
FAQs
Encodes and decodes AVIF images using WebAssembly
The npm package @saschazar/wasm-avif receives a total of 16 weekly downloads. As such, @saschazar/wasm-avif popularity was classified as not popular.
We found that @saschazar/wasm-avif demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.