Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 23 07:48
    rollingversions[bot] commented #327
  • Feb 23 07:48
    ericblade opened #327
  • Feb 23 07:48

    ericblade on snyk-fix-81ada19de863185ebf47f5c0fe9c1be0

    fix: package.json & package-loc… (compare)

  • Feb 23 07:48

    ericblade on snyk-fix-81ada19de863185ebf47f5c0fe9c1be0

    (compare)

  • Feb 22 18:33
    github-actions[bot] commented #326
  • Feb 22 18:33
    GlauberF opened #326
  • Feb 20 13:43
    imgbot[bot] synchronize #325
  • Feb 20 13:43

    imgbot[bot] on imgbot

    [ImgBot] Optimize images *Tota… (compare)

  • Feb 20 13:26
    rollingversions[bot] commented #325
  • Feb 20 13:26
    imgbot[bot] opened #325
  • Feb 20 13:26

    imgbot[bot] on imgbot

    [ImgBot] Optimize images *Tota… (compare)

  • Feb 20 12:56

    ericblade on imgbot

    (compare)

  • Feb 20 12:56

    ericblade on master

    [ImgBot] Optimize images *Tota… Merge pull request #83 from eri… (compare)

  • Feb 20 12:56
    ericblade closed #83
  • Feb 20 12:52
    rollingversions[bot] commented #83
  • Feb 20 12:52
    imgbot[bot] opened #83
  • Feb 20 12:52

    imgbot[bot] on imgbot

    [ImgBot] Optimize images *Tota… (compare)

  • Feb 15 06:33
sergiuds
@sergiuds
nvmd, contraints where not inside inputstream
Eric Blade
@ericblade
:-) hi!
@sergiuds that sounds like something we could put into the docs. i'm guessing useful for people using cameras in landscape mode? doesn't seem too useful for portrait mode
sergiuds
@sergiuds
@ericblade well, something like this, the phone will be use in portrait mode, but the video displayed should be in landscape, it seems a bit hard to achieve
Eric Blade
@ericblade
hmm. i'm.. not sure why i'd want that, but if it's useful, you're welcome to update the README and pull request, i'm always for improving the knowledge base
@stefanocali has significantly improved the new code32 reader and that was just merged .. very glad to get some progress on adding some real useful things
Eric Blade
@ericblade
@/all if anyone's paying attention here, i'm pushing up a change asap that corrects a flaw that was causing white screens in browser deployments from reasonably secure servers.
Eric Blade
@ericblade
this was completed as an urgent fix, there is some follow up to be done that will hopefully include some additional bundle size reduction. For now, I urge everyone to upgrade to 1.2.5 if possible.
Eric Blade
@ericblade
looking at another big drop in bundle size
:-D :-D :-D
well, weirdly, the node bundle is increasing in size but the browser bundles have dropped 1.3MB and 54K since my last change.. and I think there's more to be gained
Eric Blade
@ericblade
... except tests are failing utterly in node, so i may need to find a slightly different approach
Eric Blade
@ericblade
I have a drop to under 130KB for the browser minified bundle, and it still seems to work correctly :O :O
i've noticed an amazing improvement in speed of my application that uses quagga loading, since upgrading from 1.2.2 to 1.2.5 .. 1.2.6 should have as much of a gain there
we're about 33k larger than the bundle size from when we forked, and I don't expect to make a 1.x tree any less than that... however i do have some inklings for a 2.x tree someday that will eliminate a LOT of code from the main bundle, and offload it to separate pieces, so you're not saddled with having all the code for all the options you never use.
Eric Blade
@ericblade
ok, 128k looks to be the lower bound for right now
Eric Blade
@ericblade
1.2.6 is in the process of publishing right now, and has a 128k browser bundle size!!! only 30k up since the fork, and a better than 50% reduction since the first versions that used the new webpack!!!!!!!!!
Eric Blade
@ericblade
Happy holidays all!
Gabriel Balint
@zadof
Hello, anybody would be able to help with why some barcodes are hard to read? Seems pretty simple, but it takes a lot of time to read it
Eric Blade
@ericblade
hi there. my best advice is make sure you're using the best resolution you can, make sure you're not using a wide-angle camera lens, and make sure there's as much empty-space around the barcodes as possible... you can use something like the original repo's demonstration to try to adjust your quagga settings for the best results for your use case .. (i do hope to have time to get that demo up from my repo somewhere, or something similar, but haven't had time to even touch quagga in quite a while)
Gabriel Balint
@zadof
I did but it is scanning very slow, it does eventually, but it takes 5-10 seconds of adjusting the camera relative to the barcode
Eric Blade
@ericblade
what kind of a camera device @zadof ?
Gabriel Balint
@zadof
iphone 12 Pro, the problem is the blurry barcode, if it's a little too small it can't read it, whereas commercial libraries read it pretty fast, almost instant
Eric Blade
@ericblade
@zadof i would check to see if there are multiple camera devices showing up, and if there are, try a different one. A lot of modern phones have separate logical devices for different camera attributes (namely wide-angle lens, being very common), and it's really difficult to read a barcode with a wide-angle lens.
like on my LG G6, enumerateDevices shows there are 2 rear cameras and a front camera, the default rear is near impossible to use, have to force select the second one
Gabriel Balint
@zadof
Wouldn't the image you see in the live feed give you that understanding?
Eric Blade
@ericblade
just something to try, i don't know the iphone at all, last iOS device i owned was an iPad 2
i know i've got an ios user on my application that says the scanner works great, we're scanning UPC/EAN codes with it
Gabriel Balint
@zadof
I see, on iPhone we get better results overall, but still not great, I think it is because of the lack of focus control, and ability to read blurry barcodes
Eric Blade
@ericblade
so, there are two things i do know about iOS wrt quagga, one is that the newest version of iOS if you use a "max 100" aspect ratio constraint, it'll actually give you a 100 aspect ratio image, which is just a black screen. no idea how/why it does that. Also, some combinations of iOS hardware/software will refuse to do certain camera resolutions that are commonly possible other devices, like 640x480
unfortunately, there is no focus control available to the HTML media apis right now
Gabriel Balint
@zadof
you are right on that aspect ratio, by default, so when you go on the demo site from QuaggaJS, the camera doesn't work, is blurry, but when you do it from your code, it works fine, but smaller barcodes you have to get them really focused so you can read them
Eric Blade
@ericblade
if you have another way of accessing the camera images (such as via a native plugin, if something like PhoneGap offers that, i'm not sure) that does allow for focus control, you could capture images some other fashion and pass them to QUagga.decodeSingle
yeaa.. small barcodes, you can try to tune the settings for, adjusting the patchsize and such, or using locate: false, with an area parameter in the config
Gabriel Balint
@zadof
tried them all for hours :) Is quaggajs applying any sharpening to the image before processing it?
Eric Blade
@ericblade
i do know of one person who reported to me that they can use autofocus on their device (it's an offbrand Android if I remember correctly) by opening their camera app and leaving it running with auto-focus enabled before opening my app
I'm not aware of anything. There is a singleChannel parameter i believe it's called, that forces it to only use a single channel of the image for data.. i've just .. not really had too many problems, using just a single setting, with common UPC/EAN codes.. so i haven't explored too much
i do only have a handful of users for my application, but this is what i use
            inputStream: {
                type: 'LiveStream',
                constraints: {
                    width: 640,
                    height: 480,
                    ...(cameraId && { deviceId: cameraId }),
                    ...(!cameraId && { facingMode: 'environment' }),
                },
                target: scannerRef.current,
            },
            locator: {
                patchSize: 'medium',
                halfSample: true,
            },
            numOfWorkers: 0,
            decoder: {
                // readers: ['qr-code-reader'],
                readers: ['upc_reader', 'ean_reader'],
            },
            locate: true,
        }, (err) => {
Gabriel Balint
@zadof
I see, we're using on code128, and when you have a small label and a few digits there, the lines are really close to each other, so any blur makes it harder
those codes you mention work fine
Eric Blade
@ericblade
i get the impression that code128 is quite well tested (as opposed to code32, which is new to the lib, and a few others that don't see much use at all that were put in by the original author).. however, you're right that code128 can be quite small, i used it in a business not long ago, because it was able to reproduce a lot of information in a short space. but i never had need to read it with quagga so i never tried
i know the readme, and i have said "try higher resolution so the image comes out better", but something to also try is lower resolution so that the barcode isn't so small. might help? not sure
and if you can get away with setting a locate area, and turning off auto-locate, then you're eliminating a large chunk of the work that makes things break sometimes
Gabriel Balint
@zadof
been trying them, I tried some commercial ones as well, found one that works instantly, all the others have a hard time
128 works, but if it's small enough and the image get a little blurry, it wont work
Lukas Visinskis
@LukasVisinskis_twitter
Hi guys, do you know if it's possible to choose what rear camera to initialize? Currently on my mobile device the app picks ultrawide lens which distorts the image and it doesn't read barcode at all.
Gabriel Balint
@zadof
I think you can provide a name of the camera to use, so you probably need a selection screen where the user picks the camera from the list
I don't think you have an automatic way to pick the "good" camera
Lukas Visinskis
@LukasVisinskis_twitter

@zadof Yeah I guess I can make a camera picker and alert users that ultrawide camera might not work for them. And yeah I agree, I can't think of a method to pick "good" camera as well.

What really bothers me is that every single other app(instagram, snapchat, myfitnesspal and etc.) They always seem to open "good" rear camera never ultrawide and never telephoto.

Is it different with native apps?

Gabriel Balint
@zadof
Not sure exactly, they just go by the name and try to pick the right one, might have some more info to go by, not sure about that