SVGcode
SVGcode copied to clipboard
Handle too large images
Right now it just fails:
colorworker.893f8723.js:1 Uncaught (in promise) RangeError: offset is out of bounds
at Int8Array.set (<anonymous>)
at colorworker.893f8723.js:1:3204
at array (colorworker.893f8723.js:1:3213)
at JA (colorworker.893f8723.js:1:3311)
at E (colorworker.893f8723.js:1:71498)
at eA (colorworker.893f8723.js:1:71745)
at async colorworker.893f8723.js:1:72579
Ideally we catch this and retry with a reduced image size.
Same... i was actually surprised the image size this tool could handle, but I finally gave it something like 4500 x 3000 and it was failing. Does anyone know the max pixel dimensions / size this tool can take?
It may just be dynamic, dependent on the available memory of the device. The app already checks if the theoretical canvas size limits are respected:
https://github.com/tomayac/SVGcode/blob/c6a89986c47e280a3e1128fcd4e1fa2b3f29ba46/src/js/preprocess.js#L122-L126