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

QRCode read error when contains '#10' #163

Closed EguitarRed closed 8 months ago

EguitarRed commented 8 months ago

This QRcode:

test_qr

Is readed incorrectly because the text contains #10.

I found an incorrect line code in ZXing.QrCode.Internal.DecodedBitStreamParser line 256.

I changed:

s:= res.toString.Replace('#13#10', '#10').Replace('#10', #13);

for:

s:= res.toString.Replace(#13+#10, #10).Replace(#10, #13);

And works correctly now.

Spelt commented 8 months ago

Thanks!

I will add the matrix code to the unit test and include the fix. Probably this weekend.

I'm also testing and releasing for mobile and Delphi 12.

On Wed, 13 Dec 2023 at 11:21, EguitarRed @.***> wrote:

This QRcode:

test_qr.png (view on web) https://github.com/Spelt/ZXing.Delphi/assets/33684165/563ad563-f506-4632-a6ec-9639097849aa

Is readed incorrectly because the text contains #10 https://github.com/Spelt/ZXing.Delphi/pull/10.

I found an incorrect line code in ZXing.QrCode.Internal.DecodedBitStreamParser line 256.

I changed:

s:= res.toString.Replace('#13 https://github.com/Spelt/ZXing.Delphi/issues/13#10', '#10 https://github.com/Spelt/ZXing.Delphi/pull/10').Replace('#10 https://github.com/Spelt/ZXing.Delphi/pull/10', #13 https://github.com/Spelt/ZXing.Delphi/issues/13);

for:

s:= res.toString.Replace(#13 https://github.com/Spelt/ZXing.Delphi/issues/13+#10 https://github.com/Spelt/ZXing.Delphi/pull/10, #10 https://github.com/Spelt/ZXing.Delphi/pull/10).Replace(#10 https://github.com/Spelt/ZXing.Delphi/pull/10, #13 https://github.com/Spelt/ZXing.Delphi/issues/13);

And works correctly now.

— Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/163, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAS3VOXBRNWTARDP6EKZJLYJF6UHAVCNFSM6AAAAABAS43DHKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZTSMZZGQYTGNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

EguitarRed commented 8 months ago

I'm currently using Zxing on Delphi 12 and testing with android 12 and 13. Works correctly.

Spelt commented 8 months ago

Thanks,

I also did not experience a problem.

On Wed, 13 Dec 2023 at 11:31, EguitarRed @.***> wrote:

I'm currently using Zxing on Delphi 12 and testing with android 12 and 13. Works correctly.

— Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/163#issuecomment-1853656095, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAS3VJG3DCEVY47K2C3AKTYJF7XPAVCNFSM6AAAAABAS43DHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJTGY2TMMBZGU . You are receiving this because you commented.Message ID: <Spelt/ZXing. @.***>

Spelt commented 8 months ago

Its commited and pushed. Thanks!