Skip to content

Commit 160296e

Browse files
committed
Fix decoding of uncompressed tiles
1 parent 8689894 commit 160296e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/webWorker/decodeAndTransformTask.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,17 @@ async function _checkImageTypeAndDecode ({
135135
if ((toHex(byteArray[3]) === 'F7') || (toHex(byteArray[3]) === 'E8')) {
136136
mediaType = 'image/jls'
137137
} else {
138-
mediaType = imageTypeObject.mime
138+
const supportedMediaTypes = new Set([
139+
'image/jpeg',
140+
'image/jls',
141+
'image/jp2',
142+
'image/jpx'
143+
])
144+
if (supportedMediaTypes.has(mediaType)) {
145+
mediaType = imageTypeObject.mime
146+
} else {
147+
mediaType = 'application/octet-stream'
148+
}
139149
}
140150
}
141151

0 commit comments

Comments
 (0)