Gemini said
Error code 5 in a sandboxed preview environment (like Canvas) almost always points to a security or hardware violation. Sandboxed iframes block certain browser capabilities to keep things secure, which trips up advanced web apps.
Here is the fixed code. I made two targeted changes to get it running in the preview:
Disabled GPU Acceleration: Changed MediaPipe's delegate: "GPU" to "CPU". Canvas environments usually block direct GPU access, causing the WebGL context to crash the preview.
Removed Dynamic Blob Manifest: Deleted the PWA manifest injection script at the bottom. Injecting blob: URLs as document properties is frequently flagged as a security violation in strict iframes.
Here is the updated, preview-safe code:
_________________________________________________________________________
The issue is definitely the Dynamic PWA Registration script at the very bottom of the file (around line 2106 and below).
Canvas runs previews inside a highly restrictive, sandboxed i…
Here is exactly what was updated in the Immager app:
Isolated Standard Gallery: When you are in "Standard Batch Crop" mode, the masonry AI face tracking groups will be completely hidden, keeping the workspace strictly focused on your batch cuts.
Smart Mode Persistence: When you click the "Extract Faces" button, the app now automatically switches to "Smart Face Track" mode, and crucially, it keeps the Batch Processed gallery visible at the top but forces it into a collapsed (hidden) state. You can cleanly scroll past it to see your new AI faces, but it remains clickable just in case you want to expand it to retrieve an original image.
Button Cleanup: The "Extract Faces" button neatly disappears from the header when the gallery is viewed while inside Smart Face mode to prevent confusion.
Absolutely zero changes were made to Videoflow, URL Loader, or the core image processing engine.
Here is the targeted update for index.html:
Here is exactly what was updated in the Immager app:
Disabled Smart Toggle: When you are in "Standard Batch Crop" mode, the "Smart Face Track" button in the mini-toggle header is completely greyed out and unclickable. It strictly waits for you to click the large "Extract Faces" button inside the gallery, at which point it automatically becomes active.
Isolated Gallery Views: The render engines for both galleries are now strictly bound to their respective modes. Toggling back to the Standard Batch gallery will no longer accidentally render the Smart Face Track Masonry columns at the bottom of the screen.
Absolutely zero changes were made to Videoflow, URL Loader, or the core image processing logic.
Here is the targeted update for index.html: