library icon indicating copy to clipboard operation
library copied to clipboard

Scan and decode with another lib then use zxing-js to parse the result

Open psyzz opened this issue 4 years ago • 9 comments

Hello,

thanks for this lib,

I'm using react-native and i already have a library to scan a qrcode/barcode and get a string result from this scan, but i'm looking for a lib to parse the string result like the zxing lib do here : https://zxing.org/w/decode.jspx

Example with a vCard type :

zxingResult

What i'm looking for is the "Parsed Result".

Can i use this lib do to that with vCard and other qrcode types ?

Regards

psyzz avatar Mar 30 '21 18:03 psyzz

Yes, it's perfectly possible. I'll try to set up an example later.

odahcam avatar Apr 11 '21 01:04 odahcam

Hello @odahcam , thanks for your time.

Could you point me in the right direction ? I saw ResultParser in the java source code but i didn't find ResultParser in the js library.

Regards, Jérémy

psyzz avatar Apr 17 '21 18:04 psyzz

Hi! Sorry I didn't do anything yet. Could you provide more info on this string's format maybe? Could you post an example string in here as well? I need to find if and what we need to do to pass the data to the library for it to get correctly decoded.

odahcam avatar Apr 18 '21 00:04 odahcam

No problem, An example would be the string i posted on the screenshot, the "Raw text"

psyzz avatar Apr 18 '21 01:04 psyzz

Like this one :

BEGIN:VCARD VERSION:3.0 N:Gump;Forrest FN:Forrest Gump ORG:Bubba Gump Shrimp Co. TITLE:Shrimp Man PHOTO;VALUE=URL;TYPE=GIF:http://www.example.com/dir_photos/my_photo.gif TEL;TYPE=WORK;VOICE:(111) 555-1212 TEL;TYPE=HOME;VOICE:(404) 555-1212 ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America LABEL;TYPE=WORK:100 Waters Edge\nBaytown, LA 30314\nUnited States of America ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America LABEL;TYPE=HOME:42 Plantation St.\nBaytown, LA 30314\nUnited States of America EMAIL;TYPE=PREF,INTERNET:[email protected] REV:20080424T195243Z END:VCARD

And the goal will be to get the "Parsed Result" like in the screenshot

psyzz avatar Apr 18 '21 01:04 psyzz

So you confirm this is the string result the library you currently use gives you? If so, I'm not sure how ZXing can help, once it would get this information from the image you are scanning/decoding but ZXing is not a VCARD parser.

odahcam avatar Apr 20 '21 21:04 odahcam

Yes i confirm this is the string result the library i currently use gives me. Here is the ResultParser from zxing Java where the result is parsed : https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/client/result/ResultParser.java

As you can see there are many different ResultParser like this one : "SMSMMSResultParser" :

https://github.com/zxing/zxing/blob/d4c3d73592e86aff480afef62ebc20ae70165e38/core/src/main/java/com/google/zxing/client/result/SMSMMSResultParser.java#L41

psyzz avatar Apr 22 '21 17:04 psyzz

@psyzz did you find a solution ? if so can you share it please ? Thank you

ShishoA avatar Nov 02 '21 15:11 ShishoA

Stale issue message

github-actions[bot] avatar Apr 29 '24 14:04 github-actions[bot]