Skip to content

Issue importing libheif as described in the docs.Β #40

@boustanihani

Description

@boustanihani

According to the docs, libheif hast to be imported like this:
https://github.com/catdad-experiments/libheif-js?tab=readme-ov-file#usage

<script type="module">
        import libheif from 'https://cdn.jsdelivr.net/npm/[email protected]/libheif-wasm/libheif-bundle.mjs';
</script>

But this does not work (in the browser console, libheif is a function).
It only works if I add window.libheif = libheif(); to the statement, why is that?

<script type="module">
        import libheif from 'https://cdn.jsdelivr.net/npm/[email protected]/libheif-wasm/libheif-bundle.mjs';
        window.libheif = libheif();
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions