Skip to content

Commit 713db65

Browse files
committed
Provide workaround for missing ICC profile
This attribute is required by the standard, but some origin servers do not include it in the metadata
1 parent b07e22a commit 713db65

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/viewer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ async function _initializeDecodersAndTransformers ({
156156
for (let i = 0; i < metadata.length; i++) {
157157
const image = metadata[i]
158158
if (image.SamplesPerPixel === 3) {
159+
if (image.bulkdataReferences.OpticalPathSequence == null) {
160+
console.warn('ICC Profile was not found')
161+
continue
162+
}
159163
const iccProfile = await fetchBulkdata({
160164
client,
161165
reference: (

0 commit comments

Comments
 (0)