Skip to content

Commit

Permalink
Fix issue tesseract-ocr#2748
Browse files Browse the repository at this point in the history
Commit 94d0f77 tried to fix issue tesseract-ocr#2741
but created a new problem.

This commit should fix both old and new issue.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Nov 8, 2019
1 parent 0406f77 commit ac46b28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ccmain/linerec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ bool Tesseract::TrainLineRecognizer(const STRING& input_imagename,
return false;
}
TrainFromBoxes(boxes, texts, block_list, &images);
if (images.NumPages() <= 0) {
if (images.PagesSize() == 0) {
tprintf("Failed to read pages from %s\n", input_imagename.c_str());
return false;
}
Expand Down
3 changes: 3 additions & 0 deletions src/ccstruct/imagedata.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ class DocumentData {
std::lock_guard<std::mutex> lock(general_mutex_);
return total_pages_;
}
size_t PagesSize() const {
return pages_.size();
}
int64_t memory_used() const {
std::lock_guard<std::mutex> lock(general_mutex_);
return memory_used_;
Expand Down

0 comments on commit ac46b28

Please sign in to comment.