Comments (7)
@yuresko here is my test code. https://github.com/huangsong/instascan/tree/master/docs it work well on my test phone (iphone7p ios 15. 、ipadmin5 12.2, android 12 pixel3),I used the modification and compilation of the code of the master branch
from instascan.
edit scanner.js
analyze() {
if (!this.video.videoWidth) {
return null;
}
//if (!this.imageBuffer) {
let videoWidth = this.video.videoWidth;
let videoHeight = this.video.videoHeight;
this.sensorWidth = videoWidth;
this.sensorHeight = videoHeight;
this.sensorLeft = Math.floor((videoWidth / 2) - (this.sensorWidth / 2));
this.sensorTop = Math.floor((videoHeight / 2) - (this.sensorHeight / 2));
this.canvas.width = this.sensorWidth;
this.canvas.height = this.sensorHeight;
this.canvasContext = this.canvas.getContext('2d');
this.imageBuffer = ZXing._resize(this.sensorWidth, this.sensorHeight);
//return null;
//}
fix this bug.
from instascan.
I found that turning the phone landscape fixed the issue for me (may not be the situation for others). I think instascan is analyzing a squished frame/image that it can't recognize.
There might also be some combinations of experimental settings in Safari that could fix it but I haven't the time to screw around with it.
from instascan.
@huangsong did your snippit resolve it? for me it still only defaults to landscape.
from instascan.
@yuresko let me know if this resolves your issue. I had no luck when trying it.
I'm hoping to hear back from @huangsong regarding my issue I posted yesterday that you responded to. Hopefully he'll be able help.
from instascan.
@huangsong ... I had the same problem and found this issue via Google. I tried your solution, but it is not working on IOS 15.3.1 (Ipad Air and Iphone8). It remains only working in landscape and not in portrait.
Another bug is the front camera is working, the back camera is not working on both my IOS devices. But maybe I have to put this in another 'issue'.
from instascan.
Worked like a charm ✨ Thanks @huangsong !
from instascan.
Related Issues (20)
- Tmz
- instascanaaa HOT 1
- Getting o.forEach is not a function while running on https. Please give me any solution. but it works on localhost
- Only one instance of babel-polyfill is allowed HOT 1
- Instascan is not displaying the camera although camera is active HOT 1
- Error : Cannot access video stream (TypeError). HOT 1
- Orientation Bug on iOS 15. HOT 5
- iOS 15 loads camera, not picking up QR code on any browser HOT 1
- Uncaught RangeError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': Out of memory at ImageData creation
- i
- Result cant show up in console log
- Orientation Change Scanner Bug HOT 9
- Uncaught (in promise) TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed. HOT 1
- Instascan do not recognize coloured QR codes, e.g. white code on green or red background HOT 3
- Error Invalid length
- iOS back camera cannot be used HOT 2
- Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true HOT 1
- cannot scan barcode only qr HOT 2
- getting [{"id":"","name":"null","_stream":null}] after Webview 118 update
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instascan.