Skip to content

Commit

Permalink
Fix demo
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Oct 18, 2023
1 parent 5f2cf81 commit d80f193
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions build-emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ if [ "$DEBUG" = "1" ]; then
fi

emcc -Wl,--whole-archive "$LIBHEIFA" -Wl,--no-whole-archive \
-sMODULARIZE=1 \
-sEXPORT_NAME="libheif" \
-sWASM_ASYNC_COMPILATION=0 \
-sALLOW_MEMORY_GROWTH \
--memory-init-file 0 \
Expand Down
5 changes: 3 additions & 2 deletions examples/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ <h1>libheif decoder demo</h1>
}.bind(this));
this.drawer = new CanvasDrawer(canvas);
this.decoder = new libheif.HeifDecoder();

console.log("Using libheif", libheif.heif_get_version());
saveSupported = this.canvas.toBlob &&
((URL && URL.createObjectURL) || navigator.msSaveOrOpenBlob);
if (saveSupported) {
Expand Down Expand Up @@ -313,8 +315,7 @@ <h1>libheif decoder demo</h1>
return;
}

console.log("Using libheif", libheif.heif_get_version());
var demo = new HeifDemo(libheif);
var demo = new HeifDemo(libheif());

show("form");

Expand Down
2 changes: 1 addition & 1 deletion scripts/test-javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

console.log("Running libheif JavaScript tests ...");

var libheif = require('../libheif.js');
var libheif = require('../libheif.js')();
console.log("Loaded libheif.js", libheif.heif_get_version());

// Decode the example file and make sure at least one image is returned.
Expand Down

0 comments on commit d80f193

Please sign in to comment.