Skip to content

Commit

Permalink
Fix image sampling when width x height < than 300x250
Browse files Browse the repository at this point in the history
When qr_code div element's width x height values are lower than 300 x
250, sampling process uses fixed width x height values (307 x 250)
disregarding custom values defined by user. This fix removes hard-coded
width x height values and uses variables instead.
  • Loading branch information
jurica.martincevic committed Dec 4, 2015
1 parent bc3171a commit 8a25457
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/html5-qrcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

var scan = function() {
if (localMediaStream) {
context.drawImage(video, 0, 0, 307, 250);
context.drawImage(video, 0, 0, width, height);

try {
qrcode.decode();
Expand Down

1 comment on commit 8a25457

@scorpiooo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this fix, in cases of lower height x width values, qr reading isn't working

Please sign in to comment.