Inside the HEIF Box Structure
A .heic file is an ISO Base Media container, not a JPEG variant. The ftyp box declares brands such as heic or mif1, meta holds the item information, location and property boxes, and mdat carries HEVC-encoded slices. A pitm box names the primary item, and iloc gives its byte extents, so a decoder must parse the box tree before touching a single pixel.
Apple can split a 48-megapixel capture into a grid item with separate tiles, each decoded independently and stitched by the container's rows and columns. libheif compiled to WebAssembly handles this assembly, but it also pulls in an HEVC decoder, which is why the module reaches a couple of megabytes and why the first conversion pauses while it initialises.