Skip to content

tesseract: disable debug fonts#1834

Merged
Frenzie merged 1 commit into
koreader:masterfrom
benoit-pierre:pr/disable_tesseract_debug_fonts
Jun 22, 2024
Merged

tesseract: disable debug fonts#1834
Frenzie merged 1 commit into
koreader:masterfrom
benoit-pierre:pr/disable_tesseract_debug_fonts

Conversation

@benoit-pierre

@benoit-pierre benoit-pierre commented Jun 22, 2024

Copy link
Copy Markdown
Member

Avoid spurious error traces:

Error in pixReadMemTiff: function not present
Error in pixReadMem: tiff: no pix returned
Error in pixaGenerateFontFromString: pix not made
Error in bmfCreate: font pixa not made

This change is Reviewable

Avoid spurious error traces:
```
Error in pixReadMemTiff: function not present
Error in pixReadMem: tiff: no pix returned
Error in pixaGenerateFontFromString: pix not made
Error in bmfCreate: font pixa not made
```
DebugPixa() {
pixa_ = pixaCreate(0);
-#ifdef TESSERACT_DISABLE_DEBUG_FONTS
+#if 1//def TESSERACT_DISABLE_DEBUG_FONTS

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patching feels a bit convoluted compared to just setting it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no knob in the build system to enable the flag… And it's only used here, so it's actually easier then having to patch CMakeLists.txt, or create a dedicated toolchain file to tweak the compilation flags just for tesseract.

(I almost used something like set(CMAKE_C_FLAGS_INIT "$(strip $(CFLAGS)) $${CPPFLAGS} $${CFLAGS}") when generating the toolchain file to make it easier to tweak those).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange, but alright.

@Frenzie Frenzie requested a review from NiLuJe June 22, 2024 08:07
@Frenzie Frenzie merged commit e8a385a into koreader:master Jun 22, 2024
@benoit-pierre benoit-pierre deleted the pr/disable_tesseract_debug_fonts branch June 22, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants