Browser-Based HEIC Decoding With libheif WASM and a Library Bug
iPhones save photos in HEIC by default, which often fails to open on Windows machines, upload forms, or older content management systems. The common workaround is an online converter that uploads images to a server, but the author shows that the browser itself can decode HEIC, falling back to a WebAssembly build of libheif where needed. The pipeline first checks the file header to detect HEIC even when files are misnamed, then loads the decoder lazily with a retry-safe promise. A bug in libheif-js 1.19.8 made the primary-image check throw on real phone photos, which the author worked around by calling the underlying export directly. Memory limits, a 64 MP cap, and device-aware worker concurrency are used to keep mobile tabs from crashing during batch conversion.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in