etes603: Return TOO_SHORT retry error for small images

If the image height is less than the sensor horizontal resolution, then
return a retry error rather than trying to submit the image for further
processing.

Related to: #251
This commit is contained in:
Marco Trevisan (Treviño) 2020-04-24 18:05:22 +02:00
parent 5d5995f201
commit c0895a858d

View file

@ -859,21 +859,29 @@ m_capture_state (FpiSsm *ssm, FpDevice *dev)
} }
else else
{ {
FpImage *img;
unsigned int img_size;
/* Remove empty parts 2 times for the 2 frames */ /* Remove empty parts 2 times for the 2 frames */
process_removefpi_end (self); process_removefpi_end (self);
process_removefpi_end (self); process_removefpi_end (self);
img_size = self->fp_height * FE_WIDTH;
img = fp_image_new (FE_WIDTH, self->fp_height); if (self->fp_height >= FE_WIDTH)
/* Images received are white on black, so invert it. */ {
/* TODO detect sweep direction */ FpImage *img = fp_image_new (FE_WIDTH, self->fp_height);
img->flags = FPI_IMAGE_COLORS_INVERTED | FPI_IMAGE_V_FLIPPED; unsigned int img_size = self->fp_height * FE_WIDTH;
img->height = self->fp_height;
process_4to8_bpp (self->fp, img_size / 2, img->data); /* Images received are white on black, so invert it. */
fp_dbg ("Sending the raw fingerprint image (%dx%d)", /* TODO detect sweep direction */
img->width, img->height); img->flags = FPI_IMAGE_COLORS_INVERTED | FPI_IMAGE_V_FLIPPED;
fpi_image_device_image_captured (idev, img); img->height = self->fp_height;
process_4to8_bpp (self->fp, img_size / 2, img->data);
fp_dbg ("Sending the raw fingerprint image (%dx%d)",
img->width, img->height);
fpi_image_device_image_captured (idev, img);
}
else
{
fpi_image_device_retry_scan (idev, FP_DEVICE_RETRY_TOO_SHORT);
}
fpi_image_device_report_finger_status (idev, FALSE); fpi_image_device_report_finger_status (idev, FALSE);
fpi_ssm_mark_completed (ssm); fpi_ssm_mark_completed (ssm);
} }