Skip to content

✨(preview) decode HEIC/HEIF images in the file preview#249

Open
sylvinus wants to merge 1 commit into
mainfrom
heic-preview
Open

✨(preview) decode HEIC/HEIF images in the file preview#249
sylvinus wants to merge 1 commit into
mainfrom
heic-preview

Conversation

@sylvinus

Copy link
Copy Markdown
Member

Replace the "not supported" fallback for HEIC/HEIF with a real viewer.

The decoder (heic-to, libheif compiled to WASM) is dynamically imported only when a HEIC/HEIF file is opened, so its ~2.9 MB payload stays out of the main bundle, and it decodes off the main thread in a Web Worker. The /csp build is used so it works under strict Content Security Policies (no unsafe-eval). On Safari, which decodes HEIC natively, the WASM download is skipped entirely. Decode failures fall back to the existing download screen.

Replace the "not supported" fallback for HEIC/HEIF with a real viewer.

The decoder (heic-to, libheif compiled to WASM) is dynamically imported
only when a HEIC/HEIF file is opened, so its ~2.9 MB payload stays out of
the main bundle, and it decodes off the main thread in a Web Worker. The
/csp build is used so it works under strict Content Security Policies (no
unsafe-eval). On Safari, which decodes HEIC natively, the WASM download is
skipped entirely. Decode failures fall back to the existing download screen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant