dwa012 / html5-qrcode

A cross platform HTML5 QR code reader.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Couldn't find enough finder patterns

ManuSbd opened this issue · comments

Hi,

I try to read a QR but i'm getting constantly this error.

This error it's relationated with canvas size?

Thanks.

I have the same problem. Despite the fact I'm able to read and decode qrcodes I really want to make my code clean. I think the camera is taking photo every X second and try to decode something on the picture if it don't find anything it throw this error but the behavior is not really what we can expect from the library. The strangest thing is when you make a stop call on the element, the function is always triggering the same error. It's quite disturbing. Hope the creator will have time to take care about it.

commented

There are 2 fixes that will improve this situation dramatically. This is especially true on mobile phones where the camera appears in portrait mode (tall and with black borders to the left and right sides).

The 1st is the canvas size issue you mentioned, apply this fix: #30

The 2nd is a collection of bugs affecting the scanner code (jsqrcode), see here: LazarSoft/jsqrcode#64

@z1ad, even manually applying those two bug fixes onto files jsqrcode-combined.min.js (for LazarSoft/jsqrcode#64) and html5-qrcode.min.js (for #30), I'm unable to decode QRCodes when my phone is in portrait mode.

Any idea of what might cause this ?
Could my reader div sizes be in cause ? <div id="reader" style="width:250px;height:300px; border: 1px solid blue; float: left"></div>

commented

@hgshoggins I have my reader div style set to width:400px; height:300px; and then scale it down with max-width:100%; for mobile portrait media query.

Did you apply all 6 bug fixes from LazarSoft/jsqrcode#64? I wasnt able to scan at all before that.

Apparently there was one missing, everything is fine for me now, even in portrait mode on a mobile phone. Thanks.