BlinkID / blinkid-android

Everything you need to add AI-driven ID scanning into your native Android app.
https://microblink.com/identity/identity-document-scanning/
438 stars 153 forks source link

DateResult and Date toString returns appended data instead of interleaved #308

Closed StanoJakAcc closed 6 months ago

StanoJakAcc commented 7 months ago

Description

After a successful scan, calling the toString() function on DateResult data returns appended data instead of interleaving them. For example: Date: %s, original string: %s, isFilledByDomainKnowledge: %s04.09.2014.04 SEPT/SEPT 14false

This string was retrieved like BlinkIdMultiSideRecognizer.getResult().getDateOfIssue().toString()

Similar results are achieved for calling the toString() function on Date data. For example for BlinkIdMultiSideRecognizer.getMrzResult().getDateOfExpiry().toString(), we get Date: %s, original string: %s, isFilledByDomainKnowledge: %s04.09.2024.240904false

I suspect this is caused by the use of append in the toString function of the Date/DateResult classes image

Environment Details

BlinkID version: 6.3.0

anjapenic commented 7 months ago

hey @StanoJakAcc, if you want to extract the date of issue, you can do it like this: BlinkIdMultiSideRecognizer.getResult().getDateOfIssue().getDate().toString() let me know if this helped or if you're expecting a different outcome

StanoJakAcc commented 7 months ago

Hi, yes we came to this same conclusion ourselves, this solution you provided works for us, we've adapted our code for it.

Nevertheless, I believe the original issue with toString() is still valid.

anjapenic commented 7 months ago

hi @StanoJakAcc, you're absolutely right, thanks for pointing out this bug, we'll make sure to fix it in our next release, v6.4.0. In the meantime, if you'd like to get this string on your end, you can do so like this:

public String toString() { return String.format(Locale.getDefault(), "Date: %s, original string: %s, isFilledByDomainKnowledge: %s", (getDate() == null ? "null" : getDate().toString()), getOriginalDateString(), isFilledByDomainKnowledge()); }

krizaa commented 6 months ago

Hi, this has been fixed in BlinkID v6.4.0. Thanks for reporting the bug and if the problem persists, please create a new issue