SVGcode icon indicating copy to clipboard operation
SVGcode copied to clipboard

Handle too large images

Open tomayac opened this issue 3 years ago • 2 comments

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.

tomayac avatar Feb 16 '22 13:02 tomayac

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?

princefishthrower avatar Oct 22 '22 19:10 princefishthrower

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

tomayac avatar Oct 24 '22 09:10 tomayac