From b5a88b9335b1b3c715d323f05326904bc21e445a Mon Sep 17 00:00:00 2001 From: Tuan Nghia Nguyen Date: Sat, 22 Aug 2026 17:37:20 +1000 Subject: [PATCH] ANSFR: bypass CheckFaceEmbedding validation for now CheckFaceEmbedding returns 1 unconditionally, ahead of the JPEG decode and the CheckFace() call, so every caller is told the submitted image is acceptable. Deliberate temporary bypass, not a fix. What stops running behind it: - argument guards -- a null Handle or a zero-length buffer used to return -1 and now returns 1 - cv::imdecode, so an undecodable JPEG is no longer rejected - ANSFacialRecognition::CheckFace, and with it the detector confidence threshold, isValidFace's geometry gate (5 landmarks inside the box, roll <= 27 deg, yaw asymmetry <= 0.5, pitch 0.15-0.75, mouth/eye ratio 0.6-1.6) and the _minFaceSize filter Enrollment callers that relied on this as a pre-check now accept any input. Revert this commit to restore the checks. Co-Authored-By: Claude Opus 5 --- modules/ANSFR/dllmain.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ANSFR/dllmain.cpp b/modules/ANSFR/dllmain.cpp index 7c32a4a..4d8a010 100644 --- a/modules/ANSFR/dllmain.cpp +++ b/modules/ANSFR/dllmain.cpp @@ -887,6 +887,8 @@ extern "C" ANSFR_API int InsertFaces(ANSCENTER::ANSFacialRecognition** extern "C" ANSFR_API int CheckFaceEmbedding(ANSCENTER::ANSFacialRecognition** Handle, unsigned char* jpeg_string, unsigned int bufferLength) { ANS_DBG("ANSFR","CheckFaceEmbedding: HandlePtr=%p, *Handle=%p, bufLen=%u", (void*)Handle, (void*)(Handle ? *Handle : nullptr), bufferLength); + + return 1; // by pass try { if (!Handle || !*Handle || !jpeg_string || bufferLength == 0) return -1; cv::Mat frame = cv::imdecode(cv::Mat(1, bufferLength, CV_8UC1, jpeg_string), cv::IMREAD_COLOR);