Spelt / ZXing.Delphi

ZXing Barcode Scanning object Pascal Library for Delphi VCL and Delphi Firemonkey
Apache License 2.0
471 stars 206 forks source link

Can't Decode Code_128 #94

Closed JohnTApp closed 4 years ago

JohnTApp commented 4 years ago

HI, Firstly thanks for the great work. I am able to scan everything I need (all EAN) except Code 128. I have complied the vcl demo on Win 10 as 32 and 64bit (Delphi Rio 10.3.3) and the barcode I try to decode also gives the result of "Unreadable". If I upload the same file for decode at https://zxing.org/ it decodes fine. Not sure if there is a bug with code 128. I have attached the image with barcode here. Kind Regards, John IMG_1695

Spelt commented 4 years ago

I’ll take a look at it soon.

Op 11 mrt. 2020 om 05:52 heeft JohnTApp notifications@github.com het volgende geschreven:

 HI, Firstly thanks for the great work. I am able to scan everything I need (all EAN) except Code 128. I have complied the vcl demo on Win 10 as 32 and 64bit and the barcode I try to decode also gives the result of "Unreadable". If I upload the same file for decode at https://zxing.org/ it decodes fine. Not sure if there is a bug with code 128. I have attached the image with barcode here. Kind Regards, John

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

JohnTApp commented 4 years ago

Many Thanks. Most Appreciated.

Spelt commented 4 years ago

Did this afternoon debugging and testing and it seems to work on Android but not in VCL and FMX for Windows.

I tested it on the .NET code and they have the same problem. The Java variant seems to work though I did not find a solution yet. I did forward your issue and I hope to get back to you soon.

JohnTApp commented 4 years ago

Many Thanks. I can confirm that I also tried with FMX and compiled for IOS and Windows without any luck So the FMX issue isn't isolated to FMX Windows. I only mention this in case it helps. Just in case this is related to the reported issue (maths problem or something) I also notice that there is a high error rate with EAN13 being recognized incorrectly as EAN-A or EAN-E. It is intermittent with subsequent scans correctly identifying as EAN13. As I said, only mentioning in case this is related. Kind Regards, John

JohnTApp commented 4 years ago

Hi Edward, Just wondering where this may be on the roadmap. Client is getting a bit antsy with me. Should I be looking at alternatives for them? or are we fairly close? Thanks, John

Spelt commented 4 years ago

Hi John

Sorry, I was under the impression that you already knew the answer because you are in this thread also: https://github.com/micjahn/ZXing.Net/issues/251 https://github.com/micjahn/ZXing.Net/issues/251

In Short: on Windows the image is not working in C# either but its working in the Java version. There are some differences between Java and C#/Delphi. did you follow his advice (50% resolution size - try 800x600) ? Your fps of 20 is a bit low. It should be 28-30 but that’s not the issue.

I can scan it with my Android Pixel 3a (64 bit, Android 10) from this screen quickly and easy.

I will close this issue but you can still reply to me via the email.

Sincerely, Edward

On 28 Apr 2020, at 08:19, JohnTApp notifications@github.com wrote:

Hi Edward, Just wondering where this may be on the roadmap. Client is getting a bit antsy with me. Should I be looking at alternatives for them? or are we fairly close? Thanks, John

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/94#issuecomment-620404224, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAS3VLCQQUYZD52DRLRZF3ROZYNXANCNFSM4LFNQUAQ.

JohnTApp commented 4 years ago

Hi Edward, Thanks for coming back to me. Unfortunately the client's solution requires ios, android and windows with the vast majority of their use case scenario being mobile platforms. I'm developing the prototype on ios (current up to date 64bit OS version and SDK as mentioned in previous post) so I guess we need to add FMX iOS to the list of not working platforms for code 128 format. I only have the options in TVideoCaptureQuality settings of LowQuality, MediumQuality, HighQuality, PhotoQuality . I use MediumQuality.in the App as that is the sweet spot for speed and reliability. I did try at each of the above higher and lower resolutions though for code 128 when I ran into trouble. When it didn't work I took a Photo of the barcode with the phone to see if I could get it to scan via the web as I wasn't sure if it was the quality of the printing on the barcode label itself that was causing my issue. When that photo was successful via the web, I submitted it with the issue to remain consistent with a known decodable image. So that particular photo is at a much higher resolution than that which I am using in the App. I couldn't work out any other way to submit an image with the issue, because given that no frame ever returns a successful result and the frame needs to be perfectly focused I can't even save one as a "Known Good" to the camera roll in the app. If I drop the image quality to TVideoCaptureQuality.LowQuality then No barcode formats decode at all. I think I may snookered and have to fall back to using a library for decoding barcodes, I can't see another way out. I sold the client on using FMX to have a cross platform single unified code base and a lot of work has been done on the business processing of the decoded barcode data using FMX. Is there a ZXing Java Library for iOS and Android (64bit) that I can call from FMX? or is there a better approach that I could take? Thanks Again, John

PS With respect to closing the issue, is that the right way to go? The issue still exists and probably will for some time. If the issue is closed, then I really do think that the description of supported formats on Git should be changed to show that Code 128 only works on Android. Not working on VCL, FMX Windows and iOS effectively rules out the other 75% of common platforms. Again, I love this initiative and applaud you and the others for the work that you have put in. I do realize that I just happened to get caught out with a less common format that slipped through the cracks. Thx, JT

On Wed, Apr 29, 2020 at 5:05 AM E Spelt notifications@github.com wrote:

Hi John

Sorry, I was under the impression that you already knew the answer because you are in this thread also: https://github.com/micjahn/ZXing.Net/issues/251 < https://github.com/micjahn/ZXing.Net/issues/251>

In Short: on Windows the image is not working in C# either but its working in the Java version. There are some differences between Java and C#/Delphi. did you follow his advice (50% resolution size - try 800x600) ? Your fps of 20 is a bit low. It should be 28-30 but that’s not the issue.

I can scan it with my Android Pixel 3a (64 bit, Android 10) from this screen quickly and easy.

I will close this issue but you can still reply to me via the email.

Sincerely, Edward

On 28 Apr 2020, at 08:19, JohnTApp notifications@github.com wrote:

Hi Edward, Just wondering where this may be on the roadmap. Client is getting a bit antsy with me. Should I be looking at alternatives for them? or are we fairly close? Thanks, John

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/Spelt/ZXing.Delphi/issues/94#issuecomment-620404224>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ADAS3VLCQQUYZD52DRLRZF3ROZYNXANCNFSM4LFNQUAQ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/94#issuecomment-620797733, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXSXNICWQG77KGGZLMF66TRO4SHDANCNFSM4LFNQUAQ .

Spelt commented 4 years ago

Hi Maybe you can take look at winsoft.sk. They also have native camera’s

About closing the issue. The thing is that your code128 is not working on Windows but others do. The code 128 barcode has many parameters to generate the bars and one of them is causing the issue on windows in my opinion. I’m using the scanner for scanning tickets without problems.

Hope it helps.

Op 29 apr. 2020 om 04:29 heeft JohnTApp notifications@github.com het volgende geschreven:

 Hi Edward, Thanks for coming back to me. Unfortunately the client's solution requires ios, android and windows with the vast majority of their use case scenario being mobile platforms. I'm developing the prototype on ios (current up to date 64bit OS version and SDK as mentioned in previous post) so I guess we need to add FMX iOS to the list of not working platforms for code 128 format. I only have the options in TVideoCaptureQuality settings of LowQuality, MediumQuality, HighQuality, PhotoQuality . I use MediumQuality.in the App as that is the sweet spot for speed and reliability. I did try at each of the above higher and lower resolutions though for code 128 when I ran into trouble. When it didn't work I took a Photo of the barcode with the phone to see if I could get it to scan via the web as I wasn't sure if it was the quality of the printing on the barcode label itself that was causing my issue. When that photo was successful via the web, I submitted it with the issue to remain consistent with a known decodable image. So that particular photo is at a much higher resolution than that which I am using in the App. I couldn't work out any other way to submit an image with the issue, because given that no frame ever returns a successful result and the frame needs to be perfectly focused I can't even save one as a "Known Good" to the camera roll in the app. If I drop the image quality to TVideoCaptureQuality.LowQuality then No barcode formats decode at all. I think I may snookered and have to fall back to using a library for decoding barcodes, I can't see another way out. I sold the client on using FMX to have a cross platform single unified code base and a lot of work has been done on the business processing of the decoded barcode data using FMX. Is there a ZXing Java Library for iOS and Android (64bit) that I can call from FMX? or is there a better approach that I could take? Thanks Again, John

PS With respect to closing the issue, is that the right way to go? The issue still exists and probably will for some time. If the issue is closed, then I really do think that the description of supported formats on Git should be changed to show that Code 128 only works on Android. Not working on VCL, FMX Windows and iOS effectively rules out the other 75% of common platforms. Again, I love this initiative and applaud you and the others for the work that you have put in. I do realize that I just happened to get caught out with a less common format that slipped through the cracks. Thx, JT

On Wed, Apr 29, 2020 at 5:05 AM E Spelt notifications@github.com wrote:

Hi John

Sorry, I was under the impression that you already knew the answer because you are in this thread also: https://github.com/micjahn/ZXing.Net/issues/251 < https://github.com/micjahn/ZXing.Net/issues/251>

In Short: on Windows the image is not working in C# either but its working in the Java version. There are some differences between Java and C#/Delphi. did you follow his advice (50% resolution size - try 800x600) ? Your fps of 20 is a bit low. It should be 28-30 but that’s not the issue.

I can scan it with my Android Pixel 3a (64 bit, Android 10) from this screen quickly and easy.

I will close this issue but you can still reply to me via the email.

Sincerely, Edward

On 28 Apr 2020, at 08:19, JohnTApp notifications@github.com wrote:

Hi Edward, Just wondering where this may be on the roadmap. Client is getting a bit antsy with me. Should I be looking at alternatives for them? or are we fairly close? Thanks, John

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/Spelt/ZXing.Delphi/issues/94#issuecomment-620404224>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ADAS3VLCQQUYZD52DRLRZF3ROZYNXANCNFSM4LFNQUAQ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/94#issuecomment-620797733, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXSXNICWQG77KGGZLMF66TRO4SHDANCNFSM4LFNQUAQ .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.