mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 12:36:52 +03:00
Catch empty ref images (#1397)
* slow down constant reboots caused by the flow. With this, after a restart due to exception/panic the first round gets delayed by 5 minutes * catch empty reference images * . Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -194,6 +196,12 @@ std::string FormatFileName(std::string input)
|
||||
}
|
||||
|
||||
|
||||
std::size_t file_size(const std::string& file_name) {
|
||||
std::ifstream file(file_name.c_str(),std::ios::in | std::ios::binary);
|
||||
if (!file) return 0;
|
||||
file.seekg (0, std::ios::end);
|
||||
return static_cast<std::size_t>(file.tellg());
|
||||
}
|
||||
|
||||
|
||||
void FindReplace(std::string& line, std::string& oldString, std::string& newString) {
|
||||
|
||||
Reference in New Issue
Block a user