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

Problem reading QR codes on windows #80

Closed Beanv587 closed 5 years ago

Beanv587 commented 5 years ago

hello I tried to scan this images,but nothing result. I tried to change the size of the image. Zoom in 100% or zoom out 50% can solve the problem

qr_problem1

Beanv587 commented 5 years ago

I went to zxing.orghttps://zxing.org/w/decode.jspx to uploaded this image and found that it can be decoded correctly.

Spelt commented 5 years ago

Hi Bean,

I just tested it with our app but it just works.

It must be something else.

On 10 Feb 2019, at 10:00, Beanv587 notifications@github.com wrote:

I went to zxing.orghttps://zxing.org/w/decode.jspx <x-msg://1/url> to uploaded this image and found that it can be decoded correctly.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/80#issuecomment-462115491, or mute the thread https://github.com/notifications/unsubscribe-auth/AMEt1ct-pT26RlG01ViGp223VI8AeaEvks5vL9-1gaJpZM4ay9UJ.

Beanv587 commented 5 years ago

Hi Spelt,

You can use demo\vclTestApp to tested it,it returns Unreadable

xx

Beanv587 commented 5 years ago

My delphi version is 10.2

Spelt commented 5 years ago

Hi

I tested it with Rio (should not make a difference) and IOS64.

Hope to look into it this week.

On 11 Feb 2019, at 03:23, Beanv587 notifications@github.com wrote:

My delphi version is 10.2

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/80#issuecomment-462205249, or mute the thread https://github.com/notifications/unsubscribe-auth/AMEt1aP1Li6fG_CB3HMXVanYblPU34QVks5vMNQ6gaJpZM4ay9UJ.

Beanv587 commented 5 years ago

ok tks

Spelt commented 5 years ago

Well, not a bug :-)

I did find the time to check it out more and this is what I found:

The barcode needs the flag: PURE_BARCODE see for flags: https://zxing.github.io/zxing/apidocs/com/google/zxing/DecodeHintType.html

It is probably a pure monochrome image which is probably a special kind.

It works if you add the flag with the decoding like in the DUnitXTest:

procedure TZXingDelphiTest.All_PURE_QRCode(); var result: TReadResult; hints: TDictionary<TDecodeHintType, TObject>; begin

try

hints := TDictionary<TDecodeHintType, TObject>.Create(); hints.Add(TDecodeHintType.PURE_BARCODE, nil);

result := Decode('beantest.jpg', TBarcodeFormat.QR_CODE, hints);

Assert.IsNotNull(result, ' Nil result '); Assert.IsTrue(result.Text.Contains('ivaservizi.'), 'QR code result Text Incorrect: ' + result.Text);

etc

Op ma 11 feb. 2019 om 14:05 schreef Beanv587 notifications@github.com:

ok tks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/80#issuecomment-462320307, or mute the thread https://github.com/notifications/unsubscribe-auth/AMEt1aQmgMx78qlmuh9Oslv1d5pkntjQks5vMWqTgaJpZM4ay9UJ .

Beanv587 commented 5 years ago

Thank you very mutch!