Closed dukesook closed 2 months ago
@dukesook
If you are pulling from the libheif-bundle you need to init the module with a function call.
const libheif = window.libheif()
const decoder = new libheif.HeifDecoder()
You can see this is done for you in wasm-bundle.js
module.exports = require('./libheif-wasm/libheif-bundle.js')();
Thanks @stevenheffner, but they gave me the following error:
window.libheif is not a function
I posted my attempt at using libheif.js here. Are there any glaring mistakes?
@dukesook here's a codepen I made showing off how to use the esmodule version from jsdelivr: https://codepen.io/catdad/pen/jOJpVJV
Let me know if this helps or if you still have any issues.
It worked for me! Thank you!
It worked for me! Thank you!
@Duefectu The codepen is working great, but when I try to create my own .html & .js files I get an error. Would you mind sharing your code?
@dukesook example.zip
@d-hand The example worked, thank you!
I'm trying to run libheif.js directly into an HTML page, but I'm getting the following error: libheif.HeifDecoder is not a constructor. Any ideas on what the problem is?
index.html
image_parser.js