Skip to content

Commit b73e9de

Browse files
Determinated738dhritzkiv
authored andcommitted
Correct WebGL2 TypedArrays handling
1 parent da3763c commit b73e9de

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎src/javascript/utils.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,7 @@ function convertPixels (pixels) {
200200
if (typeof pixels === 'object' && pixels !== null) {
201201
if (isInstanceOfType(pixels, 'ArrayBuffer')) {
202202
return new Uint8Array(pixels)
203-
} else if (isInstanceOfType(pixels, 'Uint8Array') ||
204-
isInstanceOfType(pixels, 'Uint16Array') ||
205-
isInstanceOfType(pixels, 'Uint8ClampedArray') ||
206-
isInstanceOfType(pixels, 'Float32Array')) {
203+
} else if (isTypedArray(pixels) || pixels instanceof DataView) {
207204
return unpackTypedArray(pixels)
208205
} else if (isInstanceOfType(pixels, 'Buffer')) {
209206
return new Uint8Array(pixels)

0 commit comments

Comments
 (0)