Skip to content

Commit

Permalink
Update imgProcess.js
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway authored Mar 27, 2024
1 parent 47a9802 commit e8823b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/imgProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e8823b4

Please sign in to comment.