
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@cornerstonejs/codec-openjpeg
Advanced tools
JS/WebAssembly build of [OpenJPEG](https://github.com/uclouvain/openjpeg)
This library is a JavaScript port made possible by emscripten and Chris Hafey. It is a JavaScript and WebAssembly build of OpenJPEG.
...
Using npm:
$ npm install @cornerstonejs/openjpegjs
Using yarn:
$ yarn add @cornerstonejs/openjpegjs
Using unpkg CDN:
<script src="https://unpkg.com/@???/openjpegjs"></script>
Try it in your browser here
// JS / WASM promises resolve the library
const openjpegwasm = await OpenJPEGWASM;
const openjpegjs = await OpenJPEGJS;
// Decoder
const J2KDecoder = new openjpegjs.J2KDecoder();
// Encoder
const J2KEncoder = new openjpegjs.J2KEncoder();
J2KDecoder#getEncodedBuffer([encodedBitStreamLength: int]): ArrayBuffer
J2KDecoder#getDecodedBuffer(): ArrayBuffer
J2KDecoder#readHeader(): ?
J2KDecoder#calculateSizeAtDecompositionLevel(decodeLevel: int): void
J2KDecoder#decode(): void
J2KDecoder#decodeSubResolution(decodeLevel: int, decodeLayer: int)
J2KDecoder#getFrameInfo(): FrameInfo
J2KDecoder#getNumDecomposition(): int
J2KDecoder#getIsReversible(): bool
J2KDecoder#getProgressionOrder(): int
J2KDecoder#getImageOffset(): Point
J2KDecoder#getTileSize(): Size
J2KDecoder#getTileOffset(): Point
J2KDecoder#getBlockDimensions(): Size
J2KDecoder#getNumLayers(): int
J2KDecoder#getColorSpace(): int
// ~ Setup
// const encodedArrayBuffer = ...;
const fullEncodedBitStream = new Uint8Array(encodedArrayBuffer);
const numBytes = 0;
const encodedBitStream = new Uint8Array(encodedArrayBuffer, 0, fullEncodedBitStream.length -numBytes);
// ~ DECODE
const encodedBuffer = decoder.getEncodedBuffer(encodedBitStream.length);
encodedBuffer.set(encodedBitStream);
decoder.decode(); // or .decodeSubResolution() to go by layer or level
// ~ Display (see example index.html file)
const decodedBuffer = decoder.getDecodedBuffer();
const frameInfo = decoder.getFrameInfo(); // width/height will be wrong if using decodeSubResolution
const interleaveMode = 2;
// In example index.html file
display(frameInfo, decodedBuffer, interleaveMode)
J2KEncoder#getDecodedBuffer
J2KEncoder#getEncodedBuffer
J2KEncoder#encode
J2KEncoder#setDecompositions
J2KEncoder#setQuality
J2KEncoder#setProgressionOrder
J2KEncoder#setDownSample
J2KEncoder#setImageOffset
J2KEncoder#setTileSize
J2KEncoder#setTileOffset
J2KEncoder#setBlockDimensions
J2KEncoder#setNumPrecincts
J2KEncoder#setPrecinct
J2KEncoder#setCompressionRatio
It can be difficult to contribute if your environment is not setup correctly. I highly recommend trying out VS Code's "Dev Containers" that make it easier to share and use a consistent development environment.
Remote-Containers: Open Folder in Container
yarn install
in the main codecs foldergit submodule update --init --recursive
in the main codecs folder to initiate submodulesyarn build
FAQs
JS/WebAssembly build of [OpenJPEG](https://github.com/uclouvain/openjpeg)
The npm package @cornerstonejs/codec-openjpeg receives a total of 10,645 weekly downloads. As such, @cornerstonejs/codec-openjpeg popularity was classified as popular.
We found that @cornerstonejs/codec-openjpeg demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.