Skip to content

Commit

Permalink
fix: blurry pixels bug for decoding of jpeg2000
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Dec 7, 2022
1 parent df47a2a commit cf3c120
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/shared/decoders/decodeJPEG2000.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export function initialize(decodeConfig) {
async function decodeAsync(compressedImageFrame, imageInfo) {
await initialize();
const decoder = local.decoder;
const decodeLevel = 0;
const decodeLayer = 0;

// get pointer to the source/encoded bit stream buffer in WASM memory
// that can hold the encoded bitstream
Expand All @@ -55,8 +57,8 @@ async function decodeAsync(compressedImageFrame, imageInfo) {
encodedBufferInWASM.set(compressedImageFrame);

// decode it
decoder.decode();
// decoder.decodeSubResolution(decodeLevel, decodeLayer);
// decoder.decode();
decoder.decodeSubResolution(decodeLevel, decodeLayer);
// const resolutionAtLevel = decoder.calculateSizeAtDecompositionLevel(decodeLevel);

// get information about the decoded image
Expand Down

0 comments on commit cf3c120

Please sign in to comment.