question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

decodeFromImage not working with base64

See original GitHub issue

Hello,

I am trying to implement the decodeFromImage, but i get the following error:

Error: Dimensions could be not found.
    at Function.Detector.computeDimension (Detector.js?8d8a:159)
    at Detector.processFinderPatternInfo (Detector.js?8d8a:77)
    at Detector.detect (Detector.js?8d8a:67)
    at QRCodeReader.decode (QRCodeReader.js?d263:63)
    at BrowserQRCodeReader.BrowserCodeReader.readerDecode (BrowserCodeReader.js?46a5:251)
    at BrowserQRCodeReader.BrowserCodeReader.decodeOnce (BrowserCodeReader.js?46a5:227)
    at HTMLImageElement.me.imageLoadedEventListener (BrowserCodeReader.js?46a5:172)

My code: image = base64

      userUploadedImage(image) {
          this.QRCodeImageDecoder = new BrowserQRCodeReader();
          this.QRCodeImageDecoder.decodeFromImage(undefined, this.$refs.userImage).then((result) => {
            console.log(result);
          }).catch((err) => {
            console.log(err);
          });
      },

Are there any other accepted format besides a imageURL? I saw #76 with where canvas is used, but no solution. Is canvas the way to go?

I need this for both QR and Barcode.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lephamhoangquycommented, Oct 29, 2020

We can be using codeReader .decodeFromImageUrl(base64) .then((result) => { }) .catch(() => { }); I tried and working well.

1reaction
memic84commented, Dec 17, 2018

Hope to hear something from you soon. Thanks in advance!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Decoding Image Base64 String not working - Stack Overflow
Agree, first thing to check is the base64 data on the sender and receiver end, then you can pinpoint the problem.
Read more >
Base64 to Image | Base64 Decode | Base64 Converter
Convert Base64 to image online using a free decoding tool which allows you to decode Base64 as image and preview it directly in...
Read more >
base64 — Base16, Base32, Base64, Base85 Data Encodings ...
The legacy interface does not support decoding from strings, but it does provide functions for encoding and decoding to and from file objects....
Read more >
RFC 4648: The Base16, Base32, and Base64 Data Encodings
Network Working Group S. Josefsson Request for Comments: 4648 SJD Obsoletes: 3548 ... However, MIME does not define "base 64" per se, but...
Read more >
atob() - Web APIs - MDN Web Docs
InvalidCharacterError DOMException. Thrown if encodedData is not valid base64. ... Report problems with this compatibility data on GitHub ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found