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.39k stars 536 forks source link

Bug: Not working with inline image URL #76

Closed mrlubos closed 4 years ago

mrlubos commented 5 years ago

Hey,

I am trying to use this library to decode a QR code rendered on canvas. To achieve that, I use canvas.toDataURL() to encode the QR code in the image URL. This gives us something like this.

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAACWCAYAAABkW7XSAAAM1UlEQVR4Xu2c67obqQ5EM+//0Gc+J7PHnj42VQVSX9wrfwEhLaA2UuP89evXr//92vffXy/TOXO/9h956tgajd/OM2Pvx4YzdhSXM75q1Vy+VfNhBwLTBB6bdc/D8XAUwfqzXAjW9LZl4F0JIFjPleeGdddTQNyXIYBgIVikhJc5rjj6TrAqN/C7dHOUEjq3HNc/J9V1bamd4sy1Wj/r8rXKrmJEOwSWCSBYywh/G0CwajhiBQJDAghWzQZBsGo4YgUCCNaAQFU6hGBx0CCwAwHnhjVzGEfvkbpqWCt+fkrr1BOM5N1VZQ0rjTVhvsO2YwoIzBE4WrCU16po/zo+6ftuXjVetSe+bG2lHxsQLLVzaP9KAgjWc1mVIKl2BOsrjwhBnYkAgoVgVdXxzrSv8eVLCRwtWGlqU70Mqkal5vt02NO4SAkVadoh8M/v2WbqKQrebNH9nd1VUXGL3anIPOyuCNboZqPSz9RXiu5qx9J+CQJXuGEhWH+20goHBOsSxxEnFQEEa1zDcvi96+PcgLhhKbq0Q2BD4O6CVb0hkndZCFY1fex9PYGrCdZ2QdRNZiWNGtWoHm2jOpOqQamNpcaruLf2SQkVcdovQQDBGi/T7C1ICY7aHGo8gqUI0v6VBK4gWCvgK29YqUgov2fF8NPtbjQfNyy1GrRfggCC5d+wEKxLbGmc/GYCjmCtxJ+mNs4DSuWP+3JbvT9z6mVJkX1UV0rmUvGr9jRuZY92COxGAMF6olZClxbZ1SKupITK9qgdwVqhx9hDCbwTrG6HknrKTBo2uvV0zz3LruJmWTX3rB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nREwItBEgNWrBiFAIQ6CCAYHVQxSYEINBCAMFqwYpRCECggwCC1UEVmxCAQAsBBKsFK0YhAIEOAghWB1VsQgACLQQQrBasGIUABDoIIFgdVLEJAQi0EECwWrBiFAIQ6CCAYHVQxSYEINBCAMFqwYpRCECggwCC1UEVmxCAQAsBBKsFK0YhAIEOAghWB1VsQgACLQQQrBasGIUABDoIIFgdVLEJAQi0EECwWrBiFAIQ6CCAYHVQxSYEINBCAMFqwYpRCECggwCC1UEVmxCAQAsBBKsFK0YhAIEOAghWB1VsQgACLQT+Bl9BJ9Om8CmyAAAAAElFTkSuQmCC

We then render the image on page like so.

const img = new Image();
img.height = canvas.height;
img.src = canvas.toDataURL();
img.width = canvas.width;
document.body.appendChild(img);

Finally, we try to decode our QR code.

const reader = new ZXing.BrowserQRCodeReader();
reader.decodeFromImage(img);

Unfortunately, this operation fails with the following error message.

Error
    at FinderPatternFinder.webpackJsonp../node_modules/@zxing/library/esm5/core/qrcode/detector/FinderPatternFinder.js.FinderPatternFinder.selectBestPatterns (FinderPatternFinder.js:546)
    at FinderPatternFinder.webpackJsonp../node_modules/@zxing/library/esm5/core/qrcode/detector/FinderPatternFinder.js.FinderPatternFinder.find (FinderPatternFinder.js:165)
    at Detector.webpackJsonp../node_modules/@zxing/library/esm5/core/qrcode/detector/Detector.js.Detector.detect (Detector.js:66)
    at QRCodeReader.webpackJsonp../node_modules/@zxing/library/esm5/core/qrcode/QRCodeReader.js.QRCodeReader.decode (QRCodeReader.js:63)
    at BrowserQRCodeReader.webpackJsonp../node_modules/@zxing/library/esm5/browser/BrowserCodeReader.js.BrowserCodeReader.readerDecode (BrowserCodeReader.js:254)
    at BrowserQRCodeReader.webpackJsonp../node_modules/@zxing/library/esm5/browser/BrowserCodeReader.js.BrowserCodeReader.decodeOnce (BrowserCodeReader.js:229)
    at BrowserCodeReader.js:180
    at new Promise (<anonymous>)
    at BrowserQRCodeReader.webpackJsonp../node_modules/@zxing/library/esm5/browser/BrowserCodeReader.js.BrowserCodeReader.decodeFromImage (BrowserCodeReader.js:171)
    at index.js:100

If I try to screenshot the rendered <img />, save it to my computer as screenshot.jpg and modify my code as follows...

img.src = 'C:\fakepath\screenshot.jpg'

...we get back this.

{
    format: 11,
    numBits: 288,
    rawBytes: Uint8Array(36) [65, 183, 55, 87, 6, 87, 39, 54, 86, 55, 87, 38, 86, 182, 87, 151, 7, 38, 247, 
70, 86, 55, 70, 86, 70, 86, 70, 151, 64, 236, 17, 236, 17, 236, 17, 236],
    resultMetadata: Map(2) {2 => Array(1), 3 => "H"},
    resultPoints: (4) [FinderPattern, FinderPattern, FinderPattern, AlignmentPattern],
    text: "supersecurekeyprotectededit",
    timestamp: 1533052481452
}

Yay, it works! However, this is not a desired behaviour as we cannot expect the user to download a picture of the canvas on their computer and then upload it again.

Any suggestions how to fix this? I am sure there is a way to achieve what I am trying to do since scanning input from device camera is essentially doing the same thing. Thanks!

odahcam commented 5 years ago

As I can see, you're trying to decode from your new Image() instance, please try to decode from the canvas context where you "drawed" your image. 🤔

mrlubos commented 5 years ago

Hi @odahcam, thank you for helping out! Are you saying I should do the following?

const reader = new ZXing.BrowserQRCodeReader();
reader.decodeFromImage(canvas);

or perhaps pass even the context itself?

const reader = new ZXing.BrowserQRCodeReader();
reader.decodeFromImage(canvas.getContext('2d'));

Should I keep using the same function or is there a different method for canvas?

Thanks!

odahcam commented 5 years ago

Sorry 'bout that! The Browser layer is a mess at the moment. 🤦‍♂️

You can use the core reader and then pass the image's buffer (byteArray) value, you can use getImageData for that, then pass the value to decode.

Anyway, the browser code reader should work fine with the HTMLImageElement as a parameter. AS you can see here, the scanner works with the onload event, maybe that's the problem, maybe you can try passing a imageUrl by the second parameter.

Sorry for the 💩 support, I don't use the browser scanner, that's the problem here. 😅

I'm promise I'll give you support until we solve this. ⚡️

mrlubos commented 5 years ago

Hey @odahcam thank you for your support! I did not have time to look into this yet, possibly next week, could create a demo for you too to test this.

EDIT: I did try passing the imageUrl instead to second parameter as (undefined, url) before I posted the original post though, that did not help hence I created the issue.

odahcam commented 5 years ago

That's ok, if you can provide a StackBlitz or https://codesandbox.io/ like example, we probably can solve this faster. 🙂

mrlubos commented 5 years ago

Hi @odahcam, looking into this issue now. So far tried your first suggestion with canvas, passing both canvas or context as the first parameter to decodeFromImage() throws an error

Error: either src or a loaded img should be provided

I will investigate further and add any comments here. Will also create a demo if nothing helps.

mrlubos commented 5 years ago

@odahcam Looking at the second suggestion.

You can use the core reader and then pass the image's buffer (byteArray) value, you can use getImageData for that, then pass the value to decode.

So I obtain imageData like this

const imageData = ctx.createImageData(image.width, image.height);

And it's going to have a value similar to this when logged to console.

ImageData {data: Uint8ClampedArray(65536), width: 128, height: 128}
  data: Uint8ClampedArray(65536) [0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …]
  height: 128
  width: 128

I then use the core reader's decode function like this.

const QRReader = new ZXing.QRCodeReader();
QRReader.decode(imageData);

This will throw an error saying this.

QRCodeReader.js:63 Uncaught (in promise) TypeError: image.getBlackMatrix is not a function
    at QRCodeReader.webpackJsonp../node_modules/@zxing/library/esm5/core/qrcode/QRCodeReader.js.QRCodeReader.decode (QRCodeReader.js:63)
    at index.js:94

Here's the specific line where it fails.

https://github.com/zxing-js/library/blob/af16fdb2a72b331394dfe22b549703bdfefcae90/src/core/qrcode/QRCodeReader.ts#L75

mrlubos commented 5 years ago

@odahcam Passing image url to the decodeFromImage() method like this

const reader = new ZXing.BrowserQRCodeReader();
reader.decodeFromImage(undefined, img.src); // see original post for `img.src` value

causes this error.

Error
    at FinderPatternFinder.webpackJsonp../node_modules/@zxing/library/esm5/core/qrcode/detector/FinderPatternFinder.js.FinderPatternFinder.selectBestPatterns (FinderPatternFinder.js:546)
    at FinderPatternFinder.webpackJsonp../node_modules/@zxing/library/esm5/core/qrcode/detector/FinderPatternFinder.js.FinderPatternFinder.find (FinderPatternFinder.js:165)
    at Detector.webpackJsonp../node_modules/@zxing/library/esm5/core/qrcode/detector/Detector.js.Detector.detect (Detector.js:66)
    at QRCodeReader.webpackJsonp../node_modules/@zxing/library/esm5/core/qrcode/QRCodeReader.js.QRCodeReader.decode (QRCodeReader.js:63)
    at BrowserQRCodeReader.webpackJsonp../node_modules/@zxing/library/esm5/browser/BrowserCodeReader.js.BrowserCodeReader.readerDecode (BrowserCodeReader.js:252)
    at BrowserQRCodeReader.webpackJsonp../node_modules/@zxing/library/esm5/browser/BrowserCodeReader.js.BrowserCodeReader.decodeOnce (BrowserCodeReader.js:228)
    at HTMLImageElement.me.imageLoadedEventListener (BrowserCodeReader.js:173)

Looks like I need to create a demo, not sure where to go from here otherwise. Will send you link once it's ready.

mrlubos commented 5 years ago

@odahcam Hey, here is the demo as promised. Let me know if anything is not clear, although I narrowed it down as much as possible, the issue starts on line 56 to line 77. Thanks for looking into this!

odahcam commented 5 years ago

I'm glad to see that you're using react, it means we'r really going far here. 😄

Also, I saw you're using a <canvas> and that's great, because it means you don't need the HTMLImageElement for decoding nor the browser layer at all! Let's try to take that Uint8ClampedArray and pass directly into the decode method, which consumes this kinda data to decode. I'll manage to create an example for you soon!

odahcam commented 5 years ago

Well, I created the example but something stills wrong, looks like it is not in the library's code, so I would like you to take a look at it, good luck: https://codesandbox.io/s/o132m6jny

mrlubos commented 5 years ago

Hi @odahcam, thank you! I tried the same example file and it throws this error

Uncaught (in promise) Error
    at t.selectBestPatterns (index.min.js:1)
    at t.find (index.min.js:1)
    at t.detect (index.min.js:1)
    at t.decode (index.min.js:1)
    at App._callee$ (App.js? [sm]:89)
    at g (common-sandbox.edbc04b9.chunk.js:1)
    at Generator._invoke (common-sandbox.edbc04b9.chunk.js:1)
    at Generator.e.(anonymous function) [as next] (https://codesandbox.io/static/js/common-sandbox.edbc04b9.chunk.js:1:181512)
    at step (App.js? [sm]:3)
    at eval (App.js? [sm]:3)

Were you able to get it working with another file?

In the end, the use case I am trying to solve for is uploading an arbitrary pdf file, extract the QR code image from it and decode its value. If there is a way to achieve this going around this bug, that would work, do you have any suggestions?

Also, the error above throws in selectBestPatterns() which is the same function that I posted in the first post. Can you tell me what is actually going wrong there? This is the first time I use this library, all I am looking to do is decode that QR code really. 😬 (if there is another library better suited for this, I am up for suggestions)

odahcam commented 5 years ago

I was thinking in some "hints" bug, but I was unable to really prove it because I ran out of time. 😨

JoeKahl commented 5 years ago

We want to use this library, but we cannot get it to work for us. Please check out the demo that is failing. https://codesandbox.io/s/n70v00360 Your demo here: https://zxing-js.github.io/library/examples/barcode-image/ Has code that does not work for me: new ZXing.BrowserBarcodeReader('video'); For me, using the typescript library, the signature allows only a number: timeBetweenScansMillis. So it seems that your demo is not using the latest version.

odahcam commented 5 years ago

Thanks for the report and sorry for the lack of support, I'm very busy with personal business last days and it's been very hard to do a good job here, but we'll very soon get it working.

JoeKahl commented 5 years ago

Thanks for the report and sorry for the lack of support, I'm very busy with personal business last days and it's been very hard to do a good job here, but we'll very soon get it working.

Thank you for your reply. I will continue to experiment with my CodeSandbox. Maybe I am not implementing correctly. If I resolve this issue for myself I will share that news with you. https://codesandbox.io/s/n70v00360

odahcam commented 5 years ago

Thanks! I'm aware that there is an issue, but I couldn't isolate the problem yet. Probably it is not related to your code, but to the library itself.

ansarikhurshid786 commented 5 years ago

I am also facing same issue.

ghost commented 5 years ago

Is there any solution of this ? I also doing same to create Image and set src but decodeFromImage given error that "either src or a loaded img should be provided"

github-actions[bot] commented 4 years ago

Stale issue message

mrlubos commented 4 years ago

Still not fixed, bot. 🥴

odahcam commented 4 years ago

It should be working by now. I'll try to take a look this weekend.

kunal3210 commented 4 years ago

@mrlubos I had the same issue i solved it and it works.You just need to cut the data:image/png;base64, part of the string and then just pass the remaining string further to the function.It worked for me just try it.

odahcam commented 4 years ago

I have successfully decoded the following image:

image

The code I've used:

image

The base64 variable:

var base64 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOIAAADnCAIAAACMvx0zAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAA3uSURBVHhe7dKxteQ2EobRjWOz2AyUg2KQowwUwSQhR45cpbCZ7TbPuRZV/+CABDmkXl37QwHsrn/9r7XH6zVtL9Br2l6g17S9QK9pe4Fe0/YCvabtBXpN2wv0mrYX6DVtL9Br2l6g17S9QK9pe4Fe0/YCvabtBXpN2wsM1vSXX3759z/Ct2/ffNJq/7qG6ZW//vrLV73cf/7zH580MljTn3/+2c/2cr/99ptPWs0Fq5le+fPPP0Uv99lUnzTSa3qWC1YzvdJrutdrOuSC1Uyv9Jru9ZoOuWA10yu9pnu9pkMuWM30Sq/pXq/pkAtWM73Sa7rXazrkgtVMr/Sa7vWaDrlgNdMrvaZ731nTnx7J4/7m66ypH+JJvOxvblpT0WN85xf5/pqKVjM9EAWiyvfXVPQYvaZ7vaYfosfoNd3rNf0QPUav6V6v6YfoMXpN93pNP0SP0Wu612v6IXqMXtO9XtMP0WP0mu71mn6IHqPXdK/X9EP0GI9e01+v8fvvv7ugcnhNz3DBaqZXDq/p59fzO67mgsrT11S3VK/px5k1FS3Va7rXa/rRa7rXazrkgtVMr/Sa7vWaDrlgNdMrvaZ7vaZDLljN9Eqv6V6v6ZALVjO90mu612s65ILVTK/0mu71mg65YDXTK72me72mQy5YzfRKr+neF1lT0SFGzHM+EFV6Tfd6TYeMmOd8IKr0mu71mg4ZMc/5QFTpNd3rNR0yYp7zgajSa7rXazpkxDznA1Gl13Sv13TIiHnOB6JKr+ler+mQEfOcD0SVXtO9XtMhI+Y5H4gqvaZ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jkfiCqKQBSIKopH6jXdiA4xYp7zgaiiCESBqKJ4pF7TjegQI+Y5H4gqikAUiCqKR+o13YgOMWKe84GooghEgaiieKRe043oECPmOR+IKopAFIgqikfqNd2IDjFinvOBqKIIRIGoonikXtON6BAj5jkfiCqKQBSIKopH6jXdiA4xYp7zgaiiCESBqKJ4pAvX9Aq9ph+KQBSIKopHumpNf4gfsqb/GH6LQLSa6SO9phvR1+a3CESrmT7Sa7oRfW1+i0C0mukjvaYb0dfmtwhEq5k+0mu6EX1tfotAtJrpI72mG9HX5rcIRKuZPtJruhF9bX6LQLSa6SO9phvR1+a3CESrmT7Sa7oRfW1+i0C0mukjp9b0gTzub37ImpoeiALRjVy8munnHF/Td+k1HXLxaqaf02u6Ea1meiAKRDdy8Wqmn9NruhGtZnogCkQ3cvFqpp/Ta7oRrWZ6IApEN3Lxaqaf02u6Ea1meiAKRDdy8Wqmn9NruhGtZnogCkQ3cvFqpp/Ta7oRrWZ6IApEN3Lxaqaf02u6Ea1meiAKRDdy8WqmnzOY8ssvv/z7H+Hbt28+qeIXXc30QBSIbuTi1Uw/5wf8HK3N6jVtL9Br2l6g17S9QK9pe4Fe0/YCvabtBXpN2wv0mrYX6DVtL9Br2l6g17Q93v/+93/MzVmoNTXDfgAAAABJRU5ErkJggg==';

The image source is from: https://github.com/cozmo/jsQR/issues/96#issuecomment-466626352

bellaj commented 3 years ago

It seems to be an issue related to the image size. if it is modified when qr is created this problem occurs.