downsize images l.t. 500 pixels

This commit is contained in:
2025-06-14 19:57:08 +03:00
parent 373c51f0b8
commit 37a77d7228
4 changed files with 9 additions and 3 deletions

View File

@@ -199,6 +199,12 @@ std::string EmailParser::handle_image(std::string &content) {
}
if (image.empty()) return "";
if (image.rows >= 500 || image.cols >= 500) {
cv::Mat copy(image);
cv::resize(copy, image, cv::Size(150, 150), cv::INTER_LINEAR);
cv::imwrite(get_path_relative_to_home(".local/share/checks_parser/tmp.jpg"), image);
}
cv::QRCodeDetector qrDecoder = cv::QRCodeDetector();
std::string decoded_qr = qrDecoder.detectAndDecode(image);
return find_check_parameters(decoded_qr);