From 2048f328e03b4262b5e97910ff01b635ecea35ee Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Tue, 23 Mar 2021 18:24:37 +0100 Subject: [PATCH] Suppress output of page number for TIFF files with a single image Signed-off-by: Stefan Weil --- src/api/baseapi.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api/baseapi.cpp b/src/api/baseapi.cpp index 3cb4b11a..9546b227 100644 --- a/src/api/baseapi.cpp +++ b/src/api/baseapi.cpp @@ -1059,7 +1059,10 @@ bool TessBaseAPI::ProcessPagesMultipageTiff(const l_uint8 *data, size_t size, co if (pix == nullptr) { break; } - tprintf("Page %d\n", page + 1); + if (offset || page > 0) { + // Only print page number for multipage TIFF file. + tprintf("Page %d\n", page + 1); + } char page_str[kMaxIntSize]; snprintf(page_str, kMaxIntSize - 1, "%d", page); SetVariable("applybox_page", page_str);