googlesamples / android-vision

Deprecated: The Mobile Vision API is now a part of ML Kit: Check out this repo:
https://github.com/firebase/quickstart-android/tree/master/mlkit
Apache License 2.0
2.93k stars 1.73k forks source link

QrCode: VCard is recognized like plain text #139

Open IvanShafran opened 7 years ago

IvanShafran commented 7 years ago

Hi!

I noticed some problem in returned Barcode object after qr-code recognizing. Barcode object had valueFormate equal to TEXT, but In fact the qr-code contains VCard with single field "Email". Also it happens with some other single-field VCARDs.

Details:

BarcodeDetector detector = new BarcodeDetector.Builder(context)        
.setBarcodeFormats(Barcode.QR_CODE)
.build();

Qr-code and qr-code generator attached below:

(Sorry, it's in Russian) http://qrcoder.ru/?t=v

vcard_plain_text

pchx-zz commented 7 years ago

Thanks for reporting this. It looks like VCards that don't include any name fields are not properly parsed. We'll look into fixing this in a future release.

We do not ship a full VCard parser in the Barcode API; you may want to parse the rawValue yourself if you need something more robust.