Skip to content

Commit

Permalink
Don't add a page separator for a single page image (tesseract-ocr#3632)
Browse files Browse the repository at this point in the history
This change was requested in issue tesseract-ocr#3628.
  • Loading branch information
amitdo authored Nov 8, 2021
1 parent 2fbe4f5 commit 8279006
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ bool TessTextRenderer::AddImageHandler(TessBaseAPI *api) {
return false;
}

AppendString(utf8.get());

const char *pageSeparator = api->GetStringVariable("page_separator");
if (pageSeparator != nullptr && *pageSeparator != '\0') {
if (pageSeparator != nullptr && *pageSeparator != '\0' && imagenum() > 0) {
AppendString(pageSeparator);
}

AppendString(utf8.get());

return true;
}

Expand Down

0 comments on commit 8279006

Please sign in to comment.