Commit 7c3b3074 for tesseract
commit 7c3b3074a080f85d97ae533ade4a4039930f0a55
Author: Stefan Weil <sw@weilnetz.de>
Date: Fri Jun 19 15:48:26 2026 +0200
Fix duplicate symbol kNoisePadding in unity builds
The kNoisePadding constant was defined in both imagefind.cpp and
ccnontextdetect.cpp, causing duplicate symbol errors when
unity builds are enabled.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
diff --git a/src/textord/ccnontextdetect.cpp b/src/textord/ccnontextdetect.cpp
index 26ae1656..a19f5e8c 100644
--- a/src/textord/ccnontextdetect.cpp
+++ b/src/textord/ccnontextdetect.cpp
@@ -45,10 +45,6 @@ const int kMaxLargeOverlapsWithMedium = 12;
// Multiplier of original noise_count used to test for the case of spreading
// noise beyond where it should really be.
const int kOriginalNoiseMultiple = 8;
-// Pixel padding for noise blobs when rendering on the image
-// mask to encourage them to join together. Make it too big and images
-// will fatten out too much and have to be clipped to text.
-const int kNoisePadding = 4;
// Fraction of max_noise_count_ to be added to the noise count if there is
// photo mask in the background.
const double kPhotoOffsetFraction = 0.375;
diff --git a/src/textord/imagefind.cpp b/src/textord/imagefind.cpp
index acf868f1..14749bb8 100644
--- a/src/textord/imagefind.cpp
+++ b/src/textord/imagefind.cpp
@@ -46,10 +46,6 @@ const double kMaxRectangularFraction = 0.75;
const double kMaxRectangularGradient = 0.1; // About 6 degrees.
// Minimum image size to be worth looking for images on.
const int kMinImageFindSize = 100;
-// Pixel padding for noise blobs and partitions when rendering on the image
-// mask to encourage them to join together. Make it too big and images
-// will fatten out too much and have to be clipped to text.
-const int kNoisePadding = 4;
// Scans horizontally on x=[x_start,x_end), starting with y=*y_start,
// stepping y+=y_step, until y=y_end. *ystart is input/output.
diff --git a/src/textord/imagefind.h b/src/textord/imagefind.h
index ce5ef5ab..bd413de0 100644
--- a/src/textord/imagefind.h
+++ b/src/textord/imagefind.h
@@ -33,6 +33,11 @@ class TBOX;
class FCOORD;
class TO_BLOCK;
+// Pixel padding for noise blobs and partitions when rendering on the image
+// mask to encourage them to join together. Make it too big and images
+// will fatten out too much and have to be clipped to text.
+constexpr int kNoisePadding = 4;
+
// The ImageFind class is a simple static function wrapper class that
// exposes the FindImages function and some useful helper functions.
class ImageFind {