Skip to content

combine_tessdata -d outputs to stderr instead of stdout #4149

@tfmorris

Description

@tfmorris

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions