downsize images l.t. 500 pixels
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user