TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using the ZBar barcode scanning suite in the browser with WebAssembly

97 pointsby akbarnamaover 1 year ago

6 comments

mfrisbieover 1 year ago
QR codes are very easy to scan in-browser, but 1D barcodes are significantly more challenging. ~75% of the cannabis industry deals with Metrc, which forces companies to place 1D Code-128 barcode tags on everything they grow or manufacture. As a result, I&#x27;ve spent a lot of time investigating ways to scan these barcodes with a phone camera in a cross-browser webpage.<p>Ultimately, after much experimentation, the unavoidable conclusion is that the optical scanning solutions are junk. Connecting a crappy $20 HID bluetooth barcode scanner to a phone is so <i>crazily</i> better at scanning a 1D barcode than even the most massaged optical barcode scanning libraries. Industry workers that deal with these barcodes don&#x27;t even bother with phone camera scanning, it&#x27;s way too slow and temperamental.
评论 #39020092 未加载
评论 #39019459 未加载
评论 #39021184 未加载
评论 #39019165 未加载
admpover 1 year ago
There’s also the experimental <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Barcode_Detection_API" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Barcode_Det...</a> — already live in Chrome.
评论 #39015394 未加载
评论 #39021263 未加载
评论 #39015460 未加载
mhbover 1 year ago
Would be interested to know the time it takes to scan a barcode. (Compared to a hardware scanner.)
评论 #39014009 未加载
评论 #39015185 未加载
评论 #39027350 未加载
chkuendigover 1 year ago
(2018)<p>Webassembly isn&#x27;t THAT &quot;new and shiny&quot; anymore in 2024 :)
Groxxover 1 year ago
Hopefully there&#x27;s an API to access the back camera on phones instead? The front really doesn&#x27;t have the resolution necessary for many barcodes.
kylejrpover 1 year ago
eBay did a similar experiment with ZBar in WebAssembly in 2019: <a href="https:&#x2F;&#x2F;innovation.ebayinc.com&#x2F;tech&#x2F;engineering&#x2F;webassembly-at-ebay-a-real-world-use-case&#x2F;" rel="nofollow">https:&#x2F;&#x2F;innovation.ebayinc.com&#x2F;tech&#x2F;engineering&#x2F;webassembly-...</a>