Hi all,
I've been working very long on a CEF 3 tool for Adobe Photoshop. The primary feature requires file input. Everything has been working perfectly until I happened to try a file larger than 200 MB, and the extension appears to restart immediately (like hitting reload in browser).
(What's even weirder is if I had the DevTools open at the time, the extension page will load in the DevTools window and the original window goes blank. This might be Photoshop specific but thought I'd mention it if it's useful.)
I can see the File object is there, but as soon as I try creating an ArrayBuffer from it using FileReader.readAsArrayBuffer(), there is a 80-90% chance that the restart/crash happens. What's strange is it is not a guarantee that it will fail. Memory? FileReader bug?
Here's what I've tried:
1. Create an array of smaller blobs (50 MB) using File.slice
2. Loop through these to create the ArrayBuffer comprised of all the desired bytes, so instead of calling readAsArrayBuffer on the original File, it's done gradually on the smaller blobs
3. Create a DataView on this ArrayBuffer and proceed with the rest of the app (sometimes fails at this step now instead of earlier)
Unfortunately, all this did was reduce the failure rate to about 50%.
What can I do?? I've exhausted my JavaScript knowledge at this point (not an engineer by trade), but really want to see this tool through.