From e8823b440dfcd9cb90b79c6d5e9bbc22a180c08d Mon Sep 17 00:00:00 2001 From: Wei Ouyang Date: Wed, 27 Mar 2024 11:01:01 +0100 Subject: [PATCH] Update imgProcess.js --- src/imgProcess.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/imgProcess.js b/src/imgProcess.js index 7b476f5..2278aa8 100644 --- a/src/imgProcess.js +++ b/src/imgProcess.js @@ -113,6 +113,10 @@ function reverseEndianness(arrayBuffer, bytesPerElement) { } export function imjoyToTfjs(arr) { + // patch for older image.js + if(arr._rvalue instanceof ArrayBuffer){ + arr._rvalue = new Uint8Array(arr._rvalue) + } let buffer = new ArrayBuffer(arr._rvalue.length); let bufferView = new Uint8Array(buffer); bufferView.set(arr._rvalue);