Skip to content

Conversation

milahu
Copy link

@milahu milahu commented Aug 20, 2025

fix #730

also add a CLI arg parser with a pretty helptext

helptext
$ gimagereader-qt6 --help
Usage: gimagereader-qt6 [options] [files...]
A GTK/Qt frontend to tesseract OCR

Options:
  -h, --help     Displays help on commandline options.
  --help-all     Displays help, including generic Qt options.
  -v, --version  Displays version information.

Arguments:
  files          Files to open, optionally. These can be image files or hocr
                 files. Every image file is seen as one page. Hocr files can
                 reference image files for pages or graphics.

$ gimagereader-qt6 --version
gImageReader 3.4.3 (d00b33)

todo: open and save .hocr files with the GTK version

@manisandro
Copy link
Owner

Thanks, Note that there are many other locations in the code where html is the expected extension for hOCR files.

@milahu
Copy link
Author

milahu commented Aug 20, 2025

many other locations

yepp, i tried to fix some more

maybe we should add an option for the default output hocr file extension
stored in ~/.config/gImageReader/gImageReader.conf
because some users may not be happy with .hocr by default

bool hasTxt = Glib::file_test(base + ".txt", Glib::FILE_TEST_EXISTS);
bool hasHtml = Glib::file_test(base + ".html", Glib::FILE_TEST_EXISTS);
bool hasHocr = Glib::file_test(base + ".hocr", Glib::FILE_TEST_EXISTS);
// FIXME handle all cases...
Copy link
Author

Choose a reason for hiding this comment

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

needs refactoring

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.

open .hocr files

2 participants