Skip to content
Snippets Groups Projects
Commit 6440df91 authored by Thomas Boy's avatar Thomas Boy
Browse files

try to avoid error during read in the tar file

parent a4678219
No related branches found
No related tags found
No related merge requests found
...@@ -251,6 +251,7 @@ int main(int argc, char * argv[]) ...@@ -251,6 +251,7 @@ int main(int argc, char * argv[])
int everyPic= 60*5; int everyPic= 60*5;
//std::string fileName; //std::string fileName;
int frameCounter=0; int frameCounter=0;
int myFileTarWriterHeaderCounter = 0;
int frameCounterOld = -1; int frameCounterOld = -1;
vector<string> myFileErrorList;//list for pure io error vector<string> myFileErrorList;//list for pure io error
vector<string> myFileListNoContour; //list for no contours found; vector<string> myFileListNoContour; //list for no contours found;
...@@ -297,9 +298,11 @@ int main(int argc, char * argv[]) ...@@ -297,9 +298,11 @@ int main(int argc, char * argv[])
if (r != ARCHIVE_OK) if (r != ARCHIVE_OK)
{ {
cerr<<"archive_write_header() error: "<< archive_error_string(ext)<<endl; cerr<<"archive_write_header() error: "<< archive_error_string(ext)<<endl;
myFileTarWriterHeaderCounter++;
continue; //we overjump all in our for loop
} }
else //else
{ //{
//we copy all data to the buffer vector //we copy all data to the buffer vector
vec = copyDataInBuffer(archive); vec = copyDataInBuffer(archive);
if(vec.empty()) if(vec.empty())
...@@ -311,7 +314,7 @@ int main(int argc, char * argv[]) ...@@ -311,7 +314,7 @@ int main(int argc, char * argv[])
cerr<<"archive_write_finish_entry: error: "<< archive_error_string(ext) <<" will abort"<< endl; cerr<<"archive_write_finish_entry: error: "<< archive_error_string(ext) <<" will abort"<< endl;
exit(1); exit(1);
} }
} //}
//we read the image buffer as a jpg picture and decode it //we read the image buffer as a jpg picture and decode it
Mat img_input = imdecode(Mat(vec), 1); Mat img_input = imdecode(Mat(vec), 1);
...@@ -591,6 +594,8 @@ int main(int argc, char * argv[]) ...@@ -591,6 +594,8 @@ int main(int argc, char * argv[])
//TODO we should merge the file //TODO we should merge the file
cout<< "amount of libarchive read header errors :"<< myFileTarWriterHeaderCounter;
//we write the random file list to a file //we write the random file list to a file
std::string nameOutErrorList = outputDir + "fileErrorList.yml"; std::string nameOutErrorList = outputDir + "fileErrorList.yml";
cout <<"amount of file errors: "<< myFileErrorList.size()<<endl; cout <<"amount of file errors: "<< myFileErrorList.size()<<endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment