diff --git a/Analyser/Application.cpp b/Analyser/Application.cpp index c306bcc..052b8d1 100644 --- a/Analyser/Application.cpp +++ b/Analyser/Application.cpp @@ -215,7 +215,7 @@ void Application::enrollExtended(const QString &username, bool persistence, uint void Application::uploadImage(const QString &path, int operation) { m_uploadImageSendedSize = 0; - + ModuleCommunication::UploadImageInformation request; if (path.endsWith(".jpg")) { auto image = ImageDecoder::extractJpegYComponent(path.toStdString()); if (!image) { @@ -224,18 +224,21 @@ void Application::uploadImage(const QString &path, int operation) { } m_uploadBuffer = image->data; LOG(info) << "width: " << image->width << ", height: " << image->height; + request.width = image->width; + request.height = image->height; } else if (path.endsWith(".yuv")) { std::ifstream ifs(Amass::StringUtility::UTF8ToGBK(path.toStdString()), std::ofstream::binary); m_uploadBuffer = std::vector((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); if (m_uploadBuffer.empty()) { LOG(error) << "file is empty."; } + request.width = 600; + request.height = 800; } else { LOG(error) << "not supported format."; return; } - ModuleCommunication::UploadImageInformation request; mbedtls_md5_context context; mbedtls_md5_init(&context); mbedtls_md5_starts(&context); @@ -244,8 +247,6 @@ void Application::uploadImage(const QString &path, int operation) { mbedtls_md5_free(&context); request.operation = operation; - request.width = 600; - request.height = 800; request.size = m_uploadBuffer.size(); strncpy(request.username, "下发测试", sizeof(request.username)); m_communication->uploadImageInfo(request); diff --git a/Analyser/ModuleCommunication.h b/Analyser/ModuleCommunication.h index 0e6a2a6..b89ef6e 100644 --- a/Analyser/ModuleCommunication.h +++ b/Analyser/ModuleCommunication.h @@ -61,6 +61,7 @@ public: Failed4ReadFile = 19, Failed4WriteFile = 20, Failed4NoEncrypt = 21, + PalmNotDetected = 23, Needmore = 25, };