hidglobal / digitalpersona-devices

DigitalPersona Security Devices support library
https://hidglobal.github.io/digitalpersona-devices/index.html
MIT License
64 stars 41 forks source link

Can not test failed case and convert raw data image to image src #21

Open pdhung197 opened 2 years ago

pdhung197 commented 2 years ago

Dear HID,

First, I'm testing event of fingerprint reader, but I can not test the "failed" case. In QualityReport, I alway receive data like this:

deviceId: "8C630117-B87E-6B47-8D2E-5AAF6EAACC9A"
quality: 0
type: "QualityReported"

.... even when I intentionally put my whole hand on chin on the device. Another cases can not test because no event's called. So, how can I test the failed case and got correct quality (put whole the hand or chin on the device can not is a good quality case).

The second. I use this solution to convert Sample raw data to image src but seem like no luck, or have something wrong in my code. This is my code: In SampleAcquired event:

const { Data: rawData } = samples[0];
const sampleImageUrl = 'data:image/png;base64,' + btoa(Utf8.fromBase64Url(rawData));
this.imgString = sampleImageUrl;

In template: <img [src]="imgString" alt="" /> And the result like this:

image

Is there any mistake from me that make the code not work? :(

pdhung197 commented 2 years ago
  1. Duplicate with #17
  2. Solved in #11

Close issue.

a-bronx commented 2 years ago

Thanks for reporting.

Typing for the SamplesAcquired needs to be fixed, and more detailed documentation needed for different types of sample formats. Will keep the issue open until that.

a-bronx commented 2 years ago

Some findings for reference: