Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 25 15:53
    ericblade commented #467
  • Nov 25 15:51

    ericblade on npm_and_yarn

    (compare)

  • Nov 25 15:51

    ericblade on master

    build(deps): bump loader-utils … Merge pull request #468 from er… (compare)

  • Nov 25 15:51
    ericblade closed #468
  • Nov 25 15:50
    ericblade commented #469
  • Nov 25 15:48

    ericblade on npm_and_yarn

    (compare)

  • Nov 25 15:48
    dependabot[bot] edited #162
  • Nov 25 15:48

    ericblade on master

    build(deps): bump loader-utils … Merge pull request #162 from er… (compare)

  • Nov 25 15:48
    ericblade closed #162
  • Nov 25 15:48
    dependabot[bot] synchronize #162
  • Nov 25 15:48
    dependabot[bot] edited #162
  • Nov 25 15:47

    dependabot[bot] on npm_and_yarn

    build(deps): bump loader-utils … (compare)

  • Nov 25 15:47
    dependabot[bot] edited #162
  • Nov 25 15:47
    dependabot[bot] edited #162
  • Nov 25 15:47

    ericblade on npm_and_yarn

    (compare)

  • Nov 25 15:47

    ericblade on master

    build(deps): bump loader-utils … Merge pull request #163 from er… (compare)

  • Nov 25 15:47
    ericblade closed #163
  • Nov 25 15:46
    dependabot[bot] synchronize #162
  • Nov 25 15:46

    dependabot[bot] on npm_and_yarn

    build(deps): bump loader-utils … (compare)

  • Nov 25 15:46
    dependabot[bot] edited #162
Eric Blade
@ericblade
.... and 0.0.3 is released.
Eric Blade
@ericblade
just bumped to 0.0.5, added a bit of error handling centered around the new external reader feature, since i'm having some issues with getting my test external reader to work in browser. 0.0.4 is a no-op, had a packaging problem
Eric Blade
@ericblade
hmm. not a browser problem explicitly, but rather a workers problem. workers don't get updated when the reader list changes, and i'm not sure why.
Musango Wope
@musangowope

hey guys,
so this is my current configuration for the product scanner in React

import React from 'react';
import Quagga from 'quagga';
import PropTypes from 'prop-types';

class ProductScanner extends React.Component {
  constructor(props) {
    super(props);
    this.onDetected = this.onDetected.bind(this);
  }

  componentDidMount() {
    Quagga.init(
      {
        inputStream: {
          name: 'Live',
          type: 'LiveStream',
          target: document.querySelector('#interactive'),
          constraints: {
            width: 640,
            height: 480,
            facingMode: 'environment', // or user
          },
        },
        locator: {
          patchSize: 'medium',
          halfSample: true,
        },
        numOfWorkers: 1,
        decoder: {
          readers: this.props.decoderReaders,
        },
        locate: true,
      },
      function(err) {
        if (err) {
          return err;
        }
        return Quagga.start();
      },
    );
    Quagga.onDetected(this.onDetected);
  }

  componentWillUnmount() {
    Quagga.offDetected(this.onDetected);
    Quagga.stop();
  }

  onDetected(result) {
    const drawingCanvas = Quagga.canvas.dom.overlay;
    drawingCanvas.style.display = 'none';
    this.props.onDetected(result);
  }

  render() {
    return <div className={this.props.className} id="interactive" />;
  }
}

ProductScanner.propTypes = {
  className: PropTypes.string,
  onDetected: PropTypes.func.isRequired,
  decoderReaders: PropTypes.array.isRequired,
};

ProductScanner.defaultProps = {
  className: '',
};

export default ProductScanner;

the ProductScanner component accepts any decoder s in the form of an array
the current value for the prop decoderReaders is ['code_39_reader'] as that is the types of barcodes we read for our online store
This configuration works locally but on our live site, the we get this error

Uncaught ReferenceError: yca is not defined
@ericblade any insight on why this would be the case, since u have the most experience with dealing with the implementation of QuaggaJS on React
Eric Blade
@ericblade
hi @musangowope ! reading...
no, i don't. "yca" doesn't mean anything to me at all, and the code looks pretty normal
Eric Blade
@ericblade
The only thing I can come up with is that there's some difference between your dev configuration and your live configuration that is creating something invalid. Perhaps live is minifying the already minified quagga?
Musango Wope
@musangowope
@ericblade figured it out that was happening do to code splitting in webpack. We used uglifyJsPlugin which didnt play nicely with quagga in production
Eric Blade
@ericblade
were you able to fix it in some way i can add to the documentation perhaps?
Musango Wope
@musangowope
I just changed the optimization in my webpack.config.prod.js config using terserPlugin
optimization: {
    minimizer: [
      new TerserPlugin({
        sourceMap: true,
        parallel: true,
      }),
    ],
  },
Maybe adding section on webpack compatitablity with regards to minification
Eric Blade
@ericblade
hmm. i don't think i know enough about webpack to be able to describe the problem accurately. my company pays people to develop our webpack setup :-D
jimsmits19
@jimsmits19
Hello, first, thanks so much for creating and maintaining this project. I am new to QuaggaJS and just set up my first proof of concept. Unfortunately, I am getting poor results. The green box takes a long time to recognize a barcode, and when it does it spits out garbled text as opposed to what is actually encoded on the barcode. I can post my code and sample barcodes if it will help -- I am mostly wondering if there is any obvious error on my end or if anyone else has had this experience.
Eric Blade
@ericblade

hey @jimsmits19 sorry i haven't been around here the last .. several.. days. have been busy elsewhere :-)

Sure, code and samples help. Might be helpful to know what sort of hardware you're trying to use with, as well, I've been completely unable to get, for example, my PC's webcam to recognize anything at all, no matter what settings I try to use. My laptop occasionally has results. But for the most part, I only really have success with a cell camera.

Eric Blade
@ericblade
happy holidays to all :)
Eric Blade
@ericblade
fwiw, i've done a bunch of stuff with the qr test thing.. and while it still doesn't work in browser, it does provide a jumping off point for some pretty interesting improvements
Eric Blade
@ericblade
Aha! Got it!
Eric Blade
@ericblade
very close to having "official" qrcode support using jsQR . working in node and browser tests, just need to get it to work in browser when numWorkers > 0
Eric Blade
@ericblade
added quagga2-reader-qr to gitter activity
decodeSingle() works in node and browser (with numWorkers == 0) now. going to move the issue about numWorkers from that repo to the main
Eric Blade
@ericblade
0.0.8 released, add utility method to get RGBA data out of an ImageWrapper, and fix code error in loadImages wrt giving it bad image data
Eric Blade
@ericblade
well, that's probably it for my flurry of activity on it this week :-) though in the back of my mind, i'm working on how to solve that issue with numWorkers.
I really do want to get QR working fully, and then implement a reader for OCR. I know none of that has anything to do with barcodes, but I think that Quagga can make a good interface to any kind of image recognition, not just barcodes, but I don't want to tack the non-barcode stuff into the main
the last thing i want to do in my main app code is "if no barcode found, then run QR recognition, if no QR found, then run OCR" .. that's better done in this layer.
Eric Blade
@ericblade
well, i do have some bad news, in that i have now validated that the bug that prevents multiple simultaneous decodes is most definitely real, and appears to be pretty serious
Eric Blade
@ericblade
It may require a major version bump to address.
Eric Blade
@ericblade
image.png
that feels like a freakin achievement
Eric Blade
@ericblade
why did no one upgrade decodeSingle() to use a Promise :-D
Eric Blade
@ericblade
yep that's a nice improvement. makes the qr reader tiny
Eric Blade
@ericblade
crossing fingers for webpack v4 upgrade to work
Malavos
@Malavos
Amem to that!
I ended up stop using Quagga, Google Vision worked pretty well for me. But I'm looking forward to keep checking on the updates!
Eric Blade
@ericblade
@Malavos aww. I just looked at that ... "The Mobile Vision API is now a part of ML Kit. We strongly encourage you to try it out, as it comes with new capabilities like on-device image labeling! Also, note that we ultimately plan to wind down the Mobile Vision API, with all new on-device ML capabilities released via ML Kit. Feel free to reach out to Firebase support for help."
this looks like it would be interesting for phonegap/cordova users ... https://github.com/Ratsoc/cordova-plugin-google-mobile-vision-barcode-scanner#readme
probably better at some things than Quagga is
Eric Blade
@ericblade
woot woot i found the bug that causes you to have to not provide facingMode when also providing deviceId !
all thanks to Typescript telling me "hey this line doesn't make sense"
Eric Blade
@ericblade
now if i could just get the ts file to properly build... :-D
Malavos
@Malavos
@ericblade it is, I used the Firebase version for an iOs app. It rocked. But I used the Old Vision API for android. It's cool.
There are some things that are better, sure, but some (like the terms of use, lel) are not.
Eric Blade
@ericblade
... this test framework in quagga is so.. outdated.
Malavos
@Malavos
At least there is one! There are lot of open source JS/TS projects that has none.
:P
Eric Blade
@ericblade
well, i mean, it's helpful that it works, for sure, i'm doing a lot of work that without automated tests, i'd have just given up a long time ago
but it seems that it goes out of it's way to make a failing test difficult to debug
Eric Blade
@ericblade
fwiw, parallel processing with decodeSingle has been "patched" .. as in, it no longer allows it, but queues the requests to run in serial. At least it prevents incorrect results from coming out..
Eric Blade
@ericblade
Happy New Year!
Eric Blade
@ericblade
Eric Blade
@ericblade
huh. 42 downloads in one day from npm, and 10 unique clones off GitHub. I wonder if that's mostly bots or humans.