Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions packages/dicomImageLoader/src/imageLoader/decodeImageFrame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@ function decodeImageFrame(
);
case '1.2.840.10008.1.2.4.50':
// JPEG Baseline lossy process 1 (8 bit)

// Handle 8-bit JPEG Baseline color images using the browser's built-in
// JPEG decoding
if (
imageFrame.bitsAllocated === 8 &&
(imageFrame.samplesPerPixel === 3 || imageFrame.samplesPerPixel === 4)
) {
return decodeJPEGBaseline8BitColor(imageFrame, pixelData, canvas);
if (!decodeConfig?.useJPEGBaseline8BitColorWebWorker) {
// Handle 8-bit JPEG Baseline color images using the browser's built-in JPEG decoding,
// unless it has been configured to use the web-worker decoder instead.
if (
imageFrame.bitsAllocated === 8 &&
(imageFrame.samplesPerPixel === 3 || imageFrame.samplesPerPixel === 4)
) {
return decodeJPEGBaseline8BitColor(imageFrame, pixelData, canvas);
}
}

return processDecodeTask(
imageFrame,
transferSyntax,
Expand Down
Loading