-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No barcode detected #21
Comments
It could be a few things. Is there any glare or imperfections on the barcode itself? The current library used for barcode detection is OK, but it doesn't do a lot to work around imperfect images. It's also possible something broke this plugin. I'll try to test it on my end later today. |
Wow, that was fast! :-) |
I've not been able to recreate the issue consistently. The only issue I've noticed is that it doesn't do well if there isn't high contrast between the barcode and the background. The webcam I was using to test with did appear to be auto-focusing, but that may have been something the camera was doing on its own and not the barcode library. I suggest checking which formats are enabled in the plugin config (Setup > General > Camera input tab). Not all of the supported formats are enabled by default. The more formats that are enabled at once, the longer it could take to identify and the more likely there could be a misread. |
Thank You for instructions. I had no idea that almost all code formats (but one) are disabled by default. For curiosity, how long would the decoding take at most were all code formats enabled? Would it be 1 sec, 2 secs or 10? When I enabled all formats, it seemed I got no response at all. Then I enabled and tested only UPC and EAN codes. Now the plugin gives some output, but incorrect so far. I think the lack of focus may be part of the problem. Other barcode scanning software attempt continually to re-focus the camera in order to gain sharp picture of the code, but with the plugin the focus does not move at all. I would also suggest the plugin to give some hint about its status, since I couldn't tell, whether it is even working - all I could see here was some camera preview window. Other scanners display some sort of hint of the zone it is actually considering, or showing where it is seeking to detect some scanning entry points etc, and when finally scans the code, stills the image, beeps and shows a green line across the code or frame around in order to show, which part of image did it scan (useful, since often there are several barcodes on one piece of hardware). |
Almost everything about the scanning part is done withing the library I'm using. I'm not sure what information I can get from it while it is working, but I can check. There are options that show a debug overlay that shows what it is currently trying to scan. Ideally, I wanted to move away from this library and use the native Barcode Detection API if possible, but it isnt widely supported by browsers yet on the desktop side. |
There seems to be an issue with the initial config too. The Code 39 option looks like it is enabled by default, but it is just the default value that shows when the config is missing from the database. It doesn't seem like the config is created during the plugin install. With all of the codes enabled when I first created the plugin, it seemed like it wasn't working at all or very rarely. For forcing auto focus, I don't think browsers expose that kind of control but I can check. |
I'm interested. Could it improve the capabilities of scanning (namely speed and reliability)? Is the API supported for now by ANY browser? |
Only some mobile browsers have full support. https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detection_API#browser_compatibility For desktop OS devices, none have full compatibility. Those that partially implement it only do so on less used operating systems like ChromeOS and MacOS it seems. |
Using it should be more reliable since the burden of maintaining and improving it would be on the browser developers rather than the maintainers of the library I'm using. There would be more eyes on the development and a wider range of people using it. |
Do You plan on implementing this feature in some near future? E.q., giving the option in plugin config to choose the method? And, just to be sure - isn't there some free, more capable library available around? The other folks for e-banking, ticketing, URL scanning etc... they all use some propietary code? |
I just tagged a beta version of what will be the v2.1.0 release which has dropped the library the plugin was using before in favor of the native Barcode Detection API and a polyfill library for it on platforms where it is not available. From my testing using a webcam on my desktop (uses polyfill library) and my smartphone (native API), there seems to be a noticeable improvement in speed and reliability. If you are able to, could you test the new functionality? There is no release archive for the beta, but you can download the source and then run "npm install --omit=dev" in a terminal from within the plugin folder after you extract it to the correct location to install the polyfill dependency. Also, this new version drops the configuration options as no issue was noticed by letting the barcode detector try and find all supported formats at once. |
Thank You for this step. I have tested and result is excellent! I even didn't run the npm command. |
Hm, well, UPC and EAN codes are scanned in fraction of second, it's amazing, and it's great improvement indeed. However some other codes, used on hardware parts, are not scanned at all, under the same light conditions. |
The npm command is required for it to work on platforms that don't have the barcode detection API implemented like desktop browsers. Do you know what type of barcodes aren't working? |
Well, I did a snapshot of an example, but before sending, I tested scanning the picture from the monitor screen, and surprise - it is well scanned. |
Hi!
I'm trying to use the Camerainput plugin. I have it installed under GLPI with no problem, the camera icon is present near search bar.
I log in to GLPI using a browser on mobile. When I tap the camera icon in GLPI, (after neccessarry camera access confirmation) a camera window opens that shows the correct camera input.
But it does nothing else; no barcode is ever detected or scanned. When I tap the camera window, it disappears as if nothing happened.
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: