<story><title>Show HN: QuaggaJS, a barcode scanner written in JavaScript</title><url>http://serratus.github.io/quaggaJS/</url></story><parent_chain></parent_chain><comment><author>chime</author><text>Invariant to scale and rotation in JS on mobile? That&amp;#x27;s fantastic! I just tested the Red Laser native app on my phone and it can handle scale&amp;#x2F;rotation too. But I never thought about rotation for the Red Laser app and always tried to align it properly between the [ ] brackets.&lt;p&gt;I think apps that support scale&amp;#x2F;rotation should not show [ ] brackets but instead a central red +. Haven&amp;#x27;t dug deeply into how barcode_locator.js in your repo works but with the expectation that the barcode will be in the middle, you might be able to slightly optimize your code to start the location detection from the middle and expand outwards.&lt;p&gt;It appears you are breaking the image into smaller &amp;#x27;patches&amp;#x27; and looping through those to look for chunks of a barcode. Even if the algorithm is resolution independent, you might be able to exit the loop 50-60% earlier if you detect from the middle and go out in a spiral. In other words, the order in which you iterate the loop can make a difference.</text></comment>
<story><title>Show HN: QuaggaJS, a barcode scanner written in JavaScript</title><url>http://serratus.github.io/quaggaJS/</url></story><parent_chain></parent_chain><comment><author>tubelite</author><text>This is great news.&lt;p&gt;I just wrote a QRcode-reader Django widget to be used on a mobile browser, using the LazarSoft library (&lt;a href=&quot;https://github.com/LazarSoft/jsqrcode&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;LazarSoft&amp;#x2F;jsqrcode&lt;/a&gt;). The library worked great, but the HTML5 bits turned out to be surprisingly painful. Camera selection works differently in different browsers - Android Chrome has an API, Firefox throws up a selection dialog every time. Mobile Chrome doesn&amp;#x27;t let you emit audio unless it is in the context of a UI interaction (desktop Chrome does!)&lt;p&gt;Worst of all: poor autofocus. I tried multiple Android devices (Nexus 4, Moto G v2, Nexus 5) and in all cases, autofocus on getUserMedia() worked indifferently or not at all, especially close up. In contrast, native barcode&amp;#x2F;QRcode reader apps on the same devices did much better, snapping to focus very quickly.&lt;p&gt;I wonder if you faced something similar?</text></comment>