Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing a number "-1" from JS side to C/C++ side to an argument of type "unsigned long" #28

Open
flatsiedatsie opened this issue May 28, 2024 · 4 comments

Comments

@flatsiedatsie
Copy link

I just noticed this error while testing this library. The full error reads:

Passing a number "-1" from JS side to C/C++ side to an argument of type "unsigned long", which is outside the valid range [0, 4294967295]!

Screenshot 2024-05-28 at 21 18 06

This is on the Brave browser

I do actually see it working though, so it doesn't seem very important.

My code:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Scanner</title>

	<script src="https://docs.opencv.org/4.7.0/opencv.js" async></script>
	<script src="https://cdn.jsdelivr.net/gh/ColonelParrot/jscanify@master/src/jscanify.min.js"></script>
  </head>
  <body>
	  
	<video id="video"></video> <canvas id="canvas"></canvas>
	<!-- original video -->
	<canvas id="result"></canvas>
	<!-- highlighted video -->
	  
	  
	  
	  
	<script type="module">
		const scanner = new jscanify();
		const canvasCtx = canvas.getContext("2d");
		const resultCtx = result.getContext("2d");
		navigator.mediaDevices.getUserMedia({ video: true }).then((stream) => {
		  video.srcObject = stream;
		  video.onloadedmetadata = () => {
		    video.play();

		    setInterval(() => {
		      canvasCtx.drawImage(video, 0, 0);
		      const resultCanvas = scanner.highlightPaper(canvas);
		      resultCtx.drawImage(resultCanvas, 0, 0);
		    }, 10);
		  };
		});
	</script>
	
  </body>
</html>

@ColonelParrot
Copy link
Member

Works good on Chrome and Firefox with that exact snippet, so it must have something to do with Brave's handling of WebAssembly. In any case, it doesn't interfere with its function, so you should be OK 👍.

@alexkev
Copy link

alexkev commented Oct 16, 2024

@ColonelParrot I am see this same error on iOS safari browser for the extractPaper method. Any solution for this?

@lecramr
Copy link

lecramr commented Oct 17, 2024

Same Error on Chrome on MacOS :/

@ColonelParrot
Copy link
Member

I'll take a look. What code are you using @alexkev?

@ColonelParrot ColonelParrot reopened this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants