Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

combine_tessdata -d outputs to stderr instead of stdout #4149

Closed
tfmorris opened this issue Oct 23, 2023 · 0 comments · Fixed by #4150
Closed

combine_tessdata -d outputs to stderr instead of stdout #4149

tfmorris opened this issue Oct 23, 2023 · 0 comments · Fixed by #4150

Comments

@tfmorris
Copy link
Contributor

Current Behavior

The directory listing from combine_tessdata -d is sent to stderr while the network listing from combine_tessdata -l gets sent to stdout.

https://github.com/tesseract-ocr/tesseract/blob/main/src/ccutil/tessdatamanager.cpp#L214-L218

Expected Behavior

I think it would be preferable to also have the output for -d to go to stdout, but I'm not sure if there are any compatibility concerns to worry about for TessdataManager::Directory()

As a workaround (courtesy of StackOverflow), one can redirect stderr as follows to get e.g. the version string in the first line:

$ combine_tessdata -d kan.traineddata 2>&1 >/dev/null | head -n 1
Version:4.00.00alpha:kan:synth20170629:[1,36,0,1Ct3,3,16Mp3,3Lfys64Lfx96Lrx96Lfx384O1c1]

Suggested Fix

Have combine_tessdata -d send its output to stdout

tesseract -v

Current HEAD commit 51cf430

Operating System

macOS 11 Big Sur

Other Operating System

No response

uname -a

No response

Compiler

No response

CPU

No response

Virtualization / Containers

No response

Other Information

No response

tfmorris added a commit to tfmorris/tesseract that referenced this issue Oct 23, 2023
zdenop added a commit that referenced this issue Oct 24, 2023
Send output of combine_tessdata -d to stdout instead of stderr. Fixes #4149
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 a pull request may close this issue.

1 participant