sin-tanaka / vue-quagga

quaggaJS's wrapper Barcode Reader/Scanner component for Vue.js.
MIT License
53 stars 34 forks source link

Can't change size #7

Open giddan opened 5 years ago

giddan commented 5 years ago

No matter what i select it's always giving the canvaselement 640x480.

m8ow commented 5 years ago

Me either. In src/Scanner.vue, when I rewrite

          constraints: {
            width: { min: this.readerSize.width },
            height: { min: this.readerSize.height },
            facingMode: 'environment',
            aspectRatio: { min: 1, max: 2 },
          }

to

          constraints: {
            width: this.readerSize.width ,
            height: this.readerSize.height,
            facingMode: 'environment',
            aspectRatio: { min: 1, max: 2 },
          }

it looks like changing size, but I cannot scan barcodes (reading borders don't appear).

m8ow commented 5 years ago

I found that quagga.js doesn't work when video tag's size is small. For example, it doesn't work.

constraints: {
  width: 300,
  height: 200
}

I'd like to use quagga.js for responsive, so I added css transform below

video, canvas {
  transform: scale(.5);
}