zxing-js / ngx-scanner

Angular QR code, Barcode, DataMatrix, scanner component using ZXing.
https://zxing-js.github.io/ngx-scanner/
MIT License
629 stars 225 forks source link

Small QR Codes do not work #517

Open maerni opened 1 year ago

maerni commented 1 year ago

We wanted to use the ngx-scanner and installed the following versions (we use Angular 13):

@zxing/browser 0.1.1 @zxing/library 0.19.2 @zxing/ngx-scanner 3.5.0

Now we have the problem, that it does not work with small QR Codes (i.e. 3x3mm).

With normal or big QR Codes it works.

What could be the problem? How can we fix this?

Thanks.

daniyal76 commented 1 year ago

i have same problem.if we could set zoom for camera it would be better.

maerni commented 1 year ago

yes, this would be very good, if the autofocus/zoom wourd work fine. without it is not usable for me ;-(

hardik-hns commented 2 weeks ago

Do you happen to have any update on this?? I'm using the latest version 18.0.0 of @zxing/ngx-scanner but still facing this issue.

hardik-hns commented 2 weeks ago

Hi @maerni , The below link would be useful for you as it worked for me - https://github.com/zxing-js/ngx-scanner/issues/535#issue-1890431278

I added the below code in my component and it works -

ZXingScannerComponent.prototype.getAnyVideoDevice = (): Promise<MediaStream> => { return navigator.mediaDevices.getUserMedia({ audio: false, video: { width: { min: 640, ideal: 1920 }, height: { min: 400, ideal: 1080 }, aspectRatio: { ideal: 1.7777777778 } } }); };