Memory-Bounded Sequential Batch Architecture for Multi-File Camera Rolls
Why Parallel Browser Decoding Crashes on 48 MP Camera Rolls
Modern iPhone Pro camera rolls routinely mix 12 MP bursts with 24 MP and 48 MP HEIC stills. Spawning eight simultaneous WebAssembly decoders or eagerly calling File.arrayBuffer() on fifty dropped files spikes browser heap and linear WASM memory past 1 GiB, triggering tab eviction on 4 GiB and 8 GiB devices.
Our WorkerPoolController holds lazy File references in a FIFO queue of up to 100 items with zero prefetched byte buffers. Only the single active job at the head of the queue reads its ArrayBuffer, transfers ownership into the Worker, decodes via libheif-js, frees both HeifImage handles and heif_context inside a finally block, and revokes stale Blob URLs on reset.
- Working-set ceiling adapts automatically to 128 MiB on constrained devices or 256 MiB on desktop.
- Corrupted or mislabeled inputs record a structured per-file error without halting remaining photos.
- Cancelling mid-batch immediately terminates the synchronous WASM Worker and spawns a clean instance.
Individual Downloads vs Store-Mode Archive Packaging
Every converted JPEG in your queue can be saved individually for free as soon as its row finishes. When delivering full folders, unlocking the offline Date-Folder & Batch Renamer Pass bundles all succeeded items into a zero-recompression Store-mode ZIP archive with deterministic sequential names.