zxing-js / library

Multi-format 1D/2D barcode image processing library, usable in JavaScript ecosystem.
https://zxing-js.github.io/library/
Apache License 2.0
2.36k stars 535 forks source link

BrowserMultiFormatReader is not able to decode image if the image src is define as base64 data #602

Open ghevge opened 3 weeks ago

ghevge commented 3 weeks ago

Describe the bug BrowserMultiFormatReader is not able to decode image if the image src is define as base64 data

To Reproduce Steps to reproduce the behavior:

  1. Download the attached ts2.txt and rename it to .html
  2. Open it in a browser and click on the decode button

Expected behavior Image should have been decoded

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context The html file is an update of https://zxing-js.github.io/library/examples/multi-image/.

Observed error is:

No MultiFormat Readers were able to detect the code. at cr.decodeInternal (https://unpkg.com/@zxing/library@latest:1:258233) at cr.decodeWithState (https://unpkg.com/@zxing/library@latest:1:257285) at t.BrowserMultiFormatReader.decodeBitmap (https://unpkg.com/@zxing/library@latest:1:331864) at t.BrowserMultiFormatReader.decode (https://unpkg.com/@zxing/library@latest:1:35551) at n (https://unpkg.com/@zxing/library@latest:1:34976) at https://unpkg.com/@zxing/library@latest:1:35147 at new Promise () at t.BrowserMultiFormatReader.decodeOnce (https://unpkg.com/@zxing/library@latest:1:35127) at t.BrowserMultiFormatReader.decodeFromImageElement (https://unpkg.com/@zxing/library@latest:1:32734) at t.BrowserMultiFormatReader.decodeFromImage (https://unpkg.com/@zxing/library@latest:1:32103) ts2.txt