zxing-js / library

Multi-format 1D/2D barcode image processing library, usable in JavaScript ecosystem.

Home Page:https://zxing-js.github.io/library/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't update reader hints instance during scanning

hieunt1407 opened this issue · comments

Hi zxingJS team. I'm very appreciated your work to port it and I'm enjoyed you guys work very handy for my projects. But seem like I faced to this bug or using it wrong.

Describe the bug

  • I tried to update reader hints using code reader instance of hints setter but seem like it's not updated for new hints for reading.

To Reproduce
Steps to reproduce the behavior:

  1. Init reader using const codeReader = new BrowserMultiFormatReader(qrcodeHints, 1000)
  2. Scanning using codeReader.decodeFromStream() with QR code.
  3. Updated hints to ean 1D hints
const hints = new Map()
hints.set(DecodeHintType.POSSIBLE_FORMATS, eanHints)
codeReader.hints = hints

Expected behavior

  • The reader hints should updated correspondingly and it able to read eanHints only

Thanks you in advance!

I'm using below work around in order to achieve it

  • Reset the reader using codeReader.reset() and reinit it but's cause flashing on video view feed

Stale issue message