From 45dffbc0ee52af1e2cc45e2ad3f196d853e2bc4a Mon Sep 17 00:00:00 2001 From: Determinated738 Date: Sat, 13 Jun 2026 16:09:08 -0400 Subject: [PATCH] Correct WebGL2 TypedArrays handling --- src/javascript/utils.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/javascript/utils.js b/src/javascript/utils.js index 7e9a9283..e14ada64 100644 --- a/src/javascript/utils.js +++ b/src/javascript/utils.js @@ -200,10 +200,7 @@ function convertPixels (pixels) { if (typeof pixels === 'object' && pixels !== null) { if (isInstanceOfType(pixels, 'ArrayBuffer')) { return new Uint8Array(pixels) - } else if (isInstanceOfType(pixels, 'Uint8Array') || - isInstanceOfType(pixels, 'Uint16Array') || - isInstanceOfType(pixels, 'Uint8ClampedArray') || - isInstanceOfType(pixels, 'Float32Array')) { + } else if (isTypedArray(pixels) || pixels instanceof DataView) { return unpackTypedArray(pixels) } else if (isInstanceOfType(pixels, 'Buffer')) { return new Uint8Array(pixels)