Skip to content

Please allow initializeImageMagick to take an already existing WebAssembly.Module #134

@johnspurlock

Description

@johnspurlock

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

Hi there, great library! I'm running in an environment that, for security reasons, does not allow instantiating wasm modules from arbitrary byte arrays. Instead, it allows you to upload the wasm bytes at deployment time and will make a variable of type WebAssembly.Module available in the runtime as part of that deployment.

Could you please add the ability to provide this WebAssembly.Module as the argument to initializeImageMagick? (in addition to the existing URL and Uint8Array)

It is usually fairly simple to add a path that stores the module and passes it directly to the WebAssembly.Instance ctor wherever you do the WebAssembly instantiation. Only thing to keep in mind is that the importObject needs to be passed as the 2nd arg to the ctor, since it was not available earlier.

I tried to hunt down where you are doing the WebAssembly loading but could not find it!

Thanks!
- John

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions