Library: bug: not working with image from canvas

Created on 23 May 2020  路  2Comments  路  Source: zxing-js/library

Describe the bug
I want to have zxing working with a canvas.. And I can't get it to work

To Reproduce
Steps to reproduce the behavior:
I am using getImageData from a canvas context.. and using decode of zxing-js.. the result I get is:

TypeError: "CanvasRenderingContext2D.drawImage: Argument 1 could not be converted to any of: HTMLImageElement, SVGImageElement, HTMLCanvasElement, HTMLVideoElement, ImageBitmap.

I was following the tips in https://github.com/zxing-js/library/issues/76 but the bug was closed automatically, so im not sure that it was solved.

bug not a bug question

All 2 comments

TypeError: "CanvasRenderingContext2D.drawImage: Argument 1 could not be converted to any of: HTMLImageElement, SVGImageElement, HTMLCanvasElement, HTMLVideoElement, ImageBitmap.

Try passing the canvas element to the decode method instead.

uff, you are right.. sorry.. it says there

Was this page helpful?
0 / 5 - 0 ratings

Related issues

boruchsiper picture boruchsiper  路  7Comments

mc-suchecki picture mc-suchecki  路  4Comments

DKhalil picture DKhalil  路  8Comments

michael-pearson picture michael-pearson  路  6Comments

Mazecreator picture Mazecreator  路  10Comments