From e2ea7761b56e03fc68c5ec10c3ed0c131bc38b8b Mon Sep 17 00:00:00 2001 From: "andrei.borovsky@gmail.com" Date: Sun, 28 Aug 2011 16:42:53 +0000 Subject: [PATCH] 0.8.7 pre-release git-svn-id: http://yagf.googlecode.com/svn/trunk@166 bb55e26e-657b-11de-982f-55b50260c994 --- CMakeLists.txt | 10 +++++----- ChangeLog | 4 ++++ DESCRIPTION | 9 +++++---- src/configdialog.cpp | 7 +++++-- src/configdialog.ui | 12 +++++++++--- src/mainform.cpp | 19 +++++++++++++++++-- src/mainform.h | 1 + src/mainform.ui | 32 ++++++++++++++++++++++++++++++++ yagf.spec | 6 +++--- 9 files changed, 81 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa4b01f..5305574 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,11 +2,11 @@ project(yagf C CXX) cmake_minimum_required(VERSION 2.6.0) set (CMAKE_IN_SOURCE_BUILD TRUE) set(SOURCES src/main.cpp src/mainform.cpp src/qgraphicsinput.cpp src/utils.cpp src/FileChannel.cpp src/spellchecker.cpp src/FileToolBar.cpp src/BlockAnalysis.cpp src/PageAnalysis.cpp - src/SkewAnalysis.cpp src/CCAnalysis.cpp src/qxtgraphicsproxywidget.cpp src/popplerdialog.cpp src/pdfextractor.cpp src/pdf2ppt.cpp) + src/SkewAnalysis.cpp src/CCAnalysis.cpp src/qxtgraphicsproxywidget.cpp src/popplerdialog.cpp src/pdfextractor.cpp src/pdf2ppt.cpp src/ghostscr.cpp src/configdialog.cpp) set(INT_SOURCES src/preload.c) -set(UIS src/mainform.ui src/popplerdialog.ui) +set(UIS src/mainform.ui src/popplerdialog.ui src/configdialog.ui) set(MOC_HEADERS src/mainform.h src/FileChannel.h src/qgraphicsinput.h src/FileToolBar.h src/qxtgraphicsproxywidget.h src/qxtgraphicsview.h - src/popplerdialog.h src/pdfextractor.h src/pdf2ppt.h) + src/popplerdialog.h src/pdfextractor.h src/pdf2ppt.h src/configdialog.h) set (yagf_RCCS src/yagf.qrc) set(QM_FILES yagf_ru.qm yagf_lt.qm yagf_de.qm yagf_pl.qm yagf_uk.qm) set (LIB_PATH_SUFFIX ) @@ -56,10 +56,10 @@ set(CPACK_BINARY_TGZ OFF) set(CPACK_BINARY_TZ OFF) set(CPACK_BINARY_TBZ2 OFF) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Graphical front-end for cuneiform OCR tool") -set(CPACK_PACKAGE_VERSION 0.8.6) +set(CPACK_PACKAGE_VERSION 0.8.7) set(CPACK_PACKAGE_VERSION_MAJOR "0") set(CPACK_PACKAGE_VERSION_MINOR "8") -set(CPACK_PACKAGE_VERSION_PATCH "6") +set(CPACK_PACKAGE_VERSION_PATCH "7") set(CPACK_STRIP_FILES bin/yagf bin/libyagfpreload) set(CPACK_SOURCE_TBZ2 "OFF") set(CPACK_SOURCE_TGZ "ON") diff --git a/ChangeLog b/ChangeLog index 65a2987..0efaedb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +* Sun Aug 28 2011 Andrei Borovsky - 0.8.7 +- Tesseract support added +- PDF import added +- Dictionary selection bug fixed * Sun Feb 20 2011 Andrei Borovsky - 0.8.6 - Some bugs fixed - The default recognition language is now set according to the user's locale diff --git a/DESCRIPTION b/DESCRIPTION index 9fd8312..10ec6b1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,12 +1,13 @@ -YAGF is a graphical front-end for cuneiform OCR tool. +YAGF is a graphical front-end for cuneiform and tesseract OCR tools. With YAGF you can open already scanned image files or obtain new images via XSane (scanning results are automatically passed to YAGF). Once you have a scanned image you can prepare it for recognition, select particular image areas for recognition, set the recognition language and so no. Recognized text is displayed in a editor window where it can be corrected, saved to disk or copied to clipboard. YAGF also provides some facilities for a multi-page recognition (see the online help for more details). Building YAGF requires: - qt4 development tools version > 4.32 + qt4 development tools version > 4.5 libaspell development package Running YAGF requires: - Qt 4.2 or later, aspell -Of course it is desirable to have xsane installed. \ No newline at end of file + Qt 4.5 or later, aspell +Of course it is desirable to have xsane installed. +PDFimport is done using either pdftoppm or gs utilities. Make sure at least one of these is installed if you are going to recognize text from PDFs. diff --git a/src/configdialog.cpp b/src/configdialog.cpp index 7af8722..ae5ffef 100644 --- a/src/configdialog.cpp +++ b/src/configdialog.cpp @@ -32,7 +32,10 @@ int ConfigDialog::selectedEngine() void ConfigDialog::setTessDataPath(const QString &value) { - if (value.isEmpty()) { + ui->lineEdit->setText(value); +} - } +QString ConfigDialog::tessdataPath() +{ + return ui->lineEdit->text(); } diff --git a/src/configdialog.ui b/src/configdialog.ui index c58507d..7e7e879 100644 --- a/src/configdialog.ui +++ b/src/configdialog.ui @@ -6,12 +6,16 @@ 0 0 - 400 + 344 237 - Dialog + OCR Settings + + + + :/yagf.png:/yagf.png @@ -96,7 +100,9 @@ - + + + buttonBox diff --git a/src/mainform.cpp b/src/mainform.cpp index 5d2dd3b..4f7cbaf 100755 --- a/src/mainform.cpp +++ b/src/mainform.cpp @@ -66,8 +66,9 @@ #include "pdfextractor.h" #include "pdf2ppt.h" #include "ghostscr.h" +#include "configdialog.h" -const QString version = "0.8.6"; +const QString version = "0.8.7"; const QString outputBase = "output"; const QString outputExt = ".txt"; @@ -295,6 +296,20 @@ void MainForm::findTessDataPath() return; } +void MainForm::showConfigDlg() +{ + ConfigDialog dialog(this); + if (selectedEngine == UseCuneiform) + dialog.setSelectedEngine(0); + else + dialog.setSelectedEngine(1); + dialog.setTessDataPath(tessdataPath); + if (dialog.exec()) { + selectedEngine = dialog.selectedEngine() == 0 ? UseCuneiform : UseTesseract; + tessdataPath = dialog.tessdataPath(); + } +} + void MainForm::importPDF() { if (!pdfx) { @@ -986,7 +1001,7 @@ void MainForm::showAboutDlg() { QPixmap icon; icon.load(":/yagf.png"); - QMessageBox aboutBox(QMessageBox::NoIcon, trUtf8("About YAGF"), trUtf8("

YAGF - Yet Another Graphical Front-end for cuneiform

Version %1

Ⓒ 2009-2011 Andrei Borovsky

This is a free software distributed under GPL v3. Visit http://symmetrica.net/cuneiform-linux/yagf-en.html for more details.").arg(version), QMessageBox::Ok); + QMessageBox aboutBox(QMessageBox::NoIcon, trUtf8("About YAGF"), trUtf8("

YAGF - Yet Another Graphical Front-end for cuneiform and tesseract OCR engines

Version %1

Ⓒ 2009-2011 Andrei Borovsky

This is a free software distributed under GPL v3. Visit http://symmetrica.net/cuneiform-linux/yagf-en.html for more details.").arg(version), QMessageBox::Ok); aboutBox.setIconPixmap(icon); QList labels = aboutBox.findChildren(); for (int i = 0; i < labels.count(); i++) { diff --git a/src/mainform.h b/src/mainform.h index be81113..edb97ad 100755 --- a/src/mainform.h +++ b/src/mainform.h @@ -91,6 +91,7 @@ private slots: void unalignButtonClicked(); void hideToolBar(); void importPDF(); + void showConfigDlg(); void addPDFPage(QString pageName); void finishedPDF(); protected: diff --git a/src/mainform.ui b/src/mainform.ui index 6f6ebc1..f3dda69 100755 --- a/src/mainform.ui +++ b/src/mainform.ui @@ -105,7 +105,14 @@ + + + &Settings + + + + @@ -489,6 +496,14 @@ Import pages from PDF documents + + + OCR Settings + + + Set up the OCR parameters + + @@ -613,6 +628,22 @@
+ + actionOCR_Settings + triggered() + MainWindow + showConfigDlg() + + + -1 + -1 + + + 959 + 568 + + +
rotateCWButtonClicked() @@ -622,5 +653,6 @@ decreaseButtonClicked() hideToolBar() importPDF() + showConfigDlg() diff --git a/yagf.spec b/yagf.spec index 76d12b7..f8210f8 100644 --- a/yagf.spec +++ b/yagf.spec @@ -9,19 +9,19 @@ # norootforbuild Name: yagf -Version: 0.8.6 +Version: 0.8.7 Release: 1 URL: http://symmetrica.net/cuneiform-linux/yagf-ru.html License: GPLv3+ Source0: %{name}-%{version}.tar.gz Group: Productivity/Graphics/Other -Summary: Graphical frontend for Cuneiform OCR tool +Summary: Graphical frontend for Cuneiform and Tesseract OCR tools BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: libqt4-devel cmake update-desktop-files fdupes Requires: libqt4 >= 4.5 %description -YAGF is a graphical front-end for Cuneiform OCR tool. +YAGF is a graphical front-end for Cuneiform and Tesseract OCR tools. With YAGF you can open already scanned image files or obtain new images via XSane (scanning results are automatically passed to YAGF). Once you have a scanned image you can prepare it for recognition, select