Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4503

barcode-scanner: quagga reduced scan resolution

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.0.1
    • 9.0.0, 8.6.4
    • Components
    • Security Level: Jimmy
    • None
    • ZK 9.0.1 S1

      Steps to Reproduce

      Try the quagga integration e.g. with an ean13 barcode:

          <barcodescanner type=" ean" continuous="true" interval="500"
                          width="40px" height="30px"
                          onDetect='output.text = output.text + "\n" + event.getType() + " " + event.getResult();'/>
      

      compare vs larger component size

          <barcodescanner type=" ean" continuous="true" interval="500"
                          width="400px" height="300px"
                          onDetect='output.text = output.text + "\n" + event.getType() + " " + event.getResult();'/>
      

      Current Result

      scanning using a smaller preview area is impossible, while it works better using larger component dimensions

      Expected Result

      scan quality should be independent of the preview area size, and rely on the video stream quality

      Debug Information

      the qr code reader integration doesn't have this problem

      Workaround

      disable the function via script override, and size the canvas via CSS (LIMIT: works as long as the the video resolution is smaller than the component dimensions)

      zk.afterLoad('zkmax.barscanner', function() {
          var xBarcodescanner = {};
          zk.override(zkmax.barscanner.Barcodescanner, xBarcodescanner, {
              _quaggaCanvasDim : function() {
                  return {width: undefined}; //returning nothing makes it better
              }
          });//zk.override
      });//zk.afterLoad
      
      .z-barcodescanner-canvas {
          max-width: 100%;
          max-height: 100%;
      }
      

            rudyhuang rudyhuang
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 2 hours Remaining Estimate - 2 hours
                2h
                Logged:
                Time Spent - 2 hours Remaining Estimate - 2 hours
                2h