From 7f643d9dc4e3bab796feafec4d2fa8cf22f5abd6 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 11 Aug 2024 18:03:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index b918767f..f06c8db7 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1592,8 +1592,10 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat) if (mPhotoInfo.retries < (DEFAULT_TAKE_PHOTO_RETRIES - 1)) { shouldRetry = true; + char presetBuf[16] = { 0 }; + snprintf(presetBuf, sizeof(presetBuf), "%02X", mPhotoInfo.retries); // replaceAll(fullPath, ".jpg", std::string("-") + std::to_string(mPhotoInfo.retries) + ".jpg"); - replaceAll(fullPath, "_FF_", std::string("_") + std::to_string(mPhotoInfo.retries) + std::string("_")); + replaceAll(fullPath, "_FF_", std::string("_") + presetBuf + std::string("_")); XYLOG(XYLOG_SEVERITY_ERROR, "Photo is TOO dark or light(LDR=%u), will RETRY it", (uint32_t)captureResult.avgY); }