Open hristijankiko opened 4 years ago
Thanks for the very well wirtten issue. This is related to #295 and #280.
Similar issue here, not sure its the same:
PDF417 reader throws always the following error: null is not an object (evaluating 'this.detectionResultColumns[t-1].getCodewords')
when barcode is presented, it happens 100% of the time
Getting same issue too on Chrome and latest @zxing/library
version.
Cannot read property 'getCodewords' of null
@odahcam I see there's recent commits, any progress on this particular issue?
Can also confirm for:
Device: Iphone7 IOS 13.3.1 Browser: Safari
I see there's recent commits, any progress on this particular issue?
No, I was finishing the text-encoding project, so no progress in here. My next goal is to implement E2E tests for the browser layer, so we should be able to spot and fix these kind of issues.
I'm a little rusty and really do not have time to debug PDF417 now, so unless there isn't possible, I would suggest some workaround. Sorry guys.
Also, just to give some context, it doesn't happen with every PDF417 type, but it seems just in one. There's in fact a piece of decoding that is not implemented in the codebase because we couldn't port the entire code at the time the module was ported from Java. Now I believe it should be a lot easier (as contributors and I fixed a lot of stuff, created similar code in other parts of the project), so if anyone wants to take a shot, just open a PR and ping me.
I see there's recent commits, any progress on this particular issue?
No, I was finishing the text-encoding project, so no progress in here. My next goal is to implement E2E tests for the browser layer, so we should be able to spot and fix these kind of issues.
I'm a little rusty and really do not have time to debug PDF417 now, so unless there isn't possible, I would suggest some workaround. Sorry guys.
Also, just to give some context, it doesn't happen with every PDF417 type, but it seems just in one. There's in fact a piece of decoding that is not implemented in the codebase because we couldn't port the entire code at the time the module was ported from Java. Now I believe it should be a lot easier (as contributors and I fixed a lot of stuff, created similar code in other parts of the project), so if anyone wants to take a shot, just open a PR and ping me.
All good, E2E tests would point everything in the right direction and help a ton.
I'll create a mininal reproduced project very soon and provide some sample PDF 417 barcodes ( sample ID cards ) that work consistently and ones that throw this error ( I have a sample barcode that throws the error, both on the video scanning method and decodeFromImage method ) so we can narrow down whats going and go from there.
@odahcam Hey yall, i recreated a simple project that recreates the issue here: https://github.com/zacharytyhacz/zxing-pdf417-bug
Also here's some sample codes that are in my test repo that we all can use to test things:
This one consistently fails on an image upload to scan decodeFromImage()
and decodeOnceFromVideoDevice()
This one is 50/50 if it fails or successfully scans decodeFromImage()
and decodeOnceFromVideoDevice()
( this one is slightly blurry/low quality )
And no data get's found in this one, from both decodeFromImage()
and decodeOnceFromVideoDevice()
I am also getting the same issue. Any workarounds to resolve this?
Also running into the same issue, getting noCodeWords
and ChecksumException
popping up a lot. Digging into the detector code that's throwing it's in the detector when trying to find the left/right alignment.
@zacharytyhacz did you end up solving the issue with those cards?
It is a simple fix in DetectionResult.ts in core/pdf417/decoder. You have to add null checks in 2-3 places. Tried to merge that but I have lot of changes from the day I changed. Not sure whether this is fixed already. I could get it to work after fixing that.
@bradens Hey there, no I do not have a work around at the moment.
@boxidilshan You are correct about that "fix", but if you test adding a null check, the scanning gets stuck in an endless loop for some images, not good.
I did a little bit more digging and it seemed to be problems with the error correction algorithm, testing against the zxing jarfile though, it seemed like it was having problems with the same images. I was able to fix my case by getting higher quality images, which I know isn't a great fix. :|
@boxidilshan do you still have the code with the fixes you made?
@boxidilshan - would it be possible to post where these 'fixes' can be applied?
Trying to get a POC together and this is killing me.. cheers
Hello, any progress on this one? @odahcam
I would like a progress update as well @odahcam
I may look back into the code myself and see if I could make a PR fix, but I am just not familiar with the codebase and adjusting the OCR or whatever it uses to image-parse the data could be complicated ( I've never dealt with stuff like this, thats why Im using this library )
I injured my right arm and i am unable to contribute on the library for the past 4 weeks plus next 4 weeks. sorry guys, I'm doing everything I can so I heal faster.
@odahcam Hope your arm healed up!
I'm hitting this same issue as well. I'm not familiar with the code base, so if anyone has any pointers as to where/what the "fixes" are, I'd appreciate it.
hello @outprove , I am planning on taking a look this weekend to hopefully find a fix and create a PR. the code is actually pretty organized and there are tests. If you have a reproduce-able issue project, that will help a lot
Describe the bug PDF417 reader throws the error below sometimes (I would say 50% chance) when barcode gets presented to the camera.
To Reproduce Steps to reproduce the behavior:
Expected behavior It should not throw a TypeError exception when barcode is presented.
Screenshots Code used:![image](https://user-images.githubusercontent.com/8568277/84972544-6bb29b00-b162-11ea-8516-2528088feb71.png)
Error:![image](https://user-images.githubusercontent.com/8568277/84971960-36f21400-b161-11ea-9350-dfeca3a21704.png)
Desktop (please complete the following information):