Giter Site home page Giter Site logo

Comments (5)

gruhn avatar gruhn commented on May 23, 2024 1

It's a bit awkward at the moment. You have to build the web worker as separate file first. With a separate command:

./src/worker/build.sh && npm run build

However for BarcodeDetectorZXing that shouldn't be necessary because it doesn't use a worker.

from barcode-detector.

gruhn avatar gruhn commented on May 23, 2024

BarcodeDetectorJsqr is still exposed because I haven't managed to run the ZXing implementation in a Web worker yet, so I presume it's not feasible for high frequency scanning. Like a camera stream. Building should work though. Can you show me the error messages?

from barcode-detector.

marvinhinz avatar marvinhinz commented on May 23, 2024

Nevermind, i tried building it inside webpack encore that didnt work. Now i cloned your repo, modified the BarcodeDetector.ts to use the ZXing version and used microbundle to build it. Then it worked like a charm.
I am using it for live decoding of a camera stream. It uses a lot of cpu but it already works pretty good 👍🏼 Do you think with a webworker the performance would increase even more?

from barcode-detector.

gruhn avatar gruhn commented on May 23, 2024

Maybe… but the main reason is, if we don’t use a web worker, the expensive scanning operations run on the UI thread. So if that becomes too much, especially on low end devices, the UI could become less responsive. Animations have lower frame rate, clicks and other events are processed with perceivable lag, … stuff like this.

from barcode-detector.

muster-mark avatar muster-mark commented on May 23, 2024

Hi,

I am trying to build this with BarcodeDetectorZXing. I cannot build it even before making modifications though. It fails with the following error:

(rpt2 plugin) Error: /Users/mark/Desktop/barcode-detector-polyfill/src/BarcodeDetectorJsqr.ts(6,30): semantic error TS2307: Cannot find module './worker/inline-worker' or its corresponding type declarations.

from barcode-detector.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.