Skip to content

Commit

Permalink
Merge pull request opencv#23825 from ulvido:4.x
Browse files Browse the repository at this point in the history
if browser supports wasm but only asm.js path provided use asm.js as fallback
  • Loading branch information
asmorkalov authored Jun 20, 2023
2 parents 71790e1 + d6d15c1 commit 726ba02
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/js/src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ async function loadOpenCV(paths, onloadCallback) {
console.log("The OpenCV.js for wasm is loaded now");
} else if (wasmSupported) {
console.log("The browser supports wasm, but the path of OpenCV.js for wasm is empty");

if (asmPath != "") {
OPENCV_URL = asmPath;
console.log("The OpenCV.js for Asm.js is loaded as fallback.");
}
}

if (OPENCV_URL === "") {
Expand Down

0 comments on commit 726ba02

Please sign in to comment.