-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Hello!
When passing an ArrayBuffer to scribe.importFiles it throws RangeError: Maximum call stack size exceeded.
My test buffer is 236087 bytes (~236 KB) which isn't massive but I'm running on a shared hosting environment (Vercel) and I suspect that has something to do with it. It works locally with much larger files so I think it is impacted by the environment it's running in.
The line that seems to be causing it is
scribe.js/js/utils/imageUtils.js
Line 61 in 0fc036e
| const binary = String.fromCharCode(...imageUint8); |
I believe that because it's spreading in the array it's assigning a lot of resources quickly and is less efficient than some alternatives, like:
const imageUint8 = new Uint8Array(file.buffer, file.byteOffset, file.byteLength);
// Detect format from just the header
const format = detectImageFormat(file.subarray(0, 64));
const binary = file.toString('latin1');
resolve(`data:image/${format};base64,${btoa(binary)}`);
return;Thanks for your time!
Metadata
Metadata
Assignees
Labels
No labels