Skip to content

Commit 635637e

Browse files
authored
fix: decodeConfig was passed incorrectly to decode (#502)
1 parent bfdc62e commit 635637e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/shared/decodeImageFrame.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import decodeJPEGLS from './decoders/decodeJPEGLS.js';
1010
import decodeJPEG2000 from './decoders/decodeJPEG2000.js';
1111
import decodeHTJ2K from './decoders/decodeHTJ2K.js';
1212
import scaleArray from './scaling/scaleArray.js';
13+
import { getOptions } from '../imageLoader/internal/options.js';
1314

1415
function decodeImageFrame(
1516
imageFrame,
@@ -140,17 +141,17 @@ function decodeImageFrame(
140141

141142
decodePromise
142143
.then((imageFrame) => {
143-
callbackFn(
144-
postProcessDecodedPixels(imageFrame, options, start, decodeConfig)
145-
);
144+
callbackFn(postProcessDecodedPixels(imageFrame, options, start));
146145
})
147146
.catch((err) => {
148147
throw err;
149148
});
150149
}
151150

152-
function postProcessDecodedPixels(imageFrame, options, start, decodeConfig) {
153-
const { use16BitDataType } = decodeConfig;
151+
function postProcessDecodedPixels(imageFrame, options, start) {
152+
const {
153+
decodeConfig: { use16BitDataType },
154+
} = getOptions();
154155

155156
const shouldShift =
156157
imageFrame.pixelRepresentation !== undefined &&

0 commit comments

Comments
 (0)