Commit Graph

6039 Commits

Author SHA1 Message Date
Stefan Weil
fef89242a8 Use fmtlib for tprintf (unfinished, work in progress)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-07-25 10:53:39 +02:00
Stefan Weil
8d698ed1c9 Fix LGTM alerts
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-07-25 10:53:39 +02:00
Stefan Weil
19cf785bfb Use fmtlib for ERRCODE::error
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-07-25 10:53:39 +02:00
Stefan Weil
85ebc18ec0 Use fmtlib for ScrollView::SendMsg
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-07-25 10:15:20 +02:00
Stefan Weil
69e9ba7bb6 Use fmtlib for ScrollView::AddMessage
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-07-25 10:15:20 +02:00
Stefan Weil
d388446661 Add source code for formatting library fmtlib
The code was extracted from https://github.com/fmtlib/fmt.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-07-25 10:15:20 +02:00
Egor Pugin
74e226b228
Merge pull request #3878 from stweil/exit
Replace call of exit function by return statement in main function
2022-07-21 00:36:59 +03:00
Stefan Weil
989956c998 Replace call of exit function by return statement in main function
Add also a missing return statement and use EXIT_FAILURE
and EXIT_SUCCESS instead of 1 and 0 as return values.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-07-20 20:32:27 +02:00
Stefan Weil
ee34b100bf Fix double free in function vigorous_noise_removal (fixes issue #3876)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-07-19 09:29:58 +02:00
Stefan Weil
99d6717c10 Create to_win if needed in Textord::make_spline_rows (fixes issue #3875)
There still remain memory leaks for the test scenario, but those are less
urgent as they are related to code which is only used for debugging.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-07-19 08:45:22 +02:00
Stefan Weil
8c573e4cef
autotools: Add rule for svpaint executable (#3873)
Move also its source code svpaint.cpp from src/viewer/ to src/,
so it is no longer included in libtesseract by the cmake build.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-07-19 00:50:01 +03:00
Stefan Weil
e589bfa58b
Merge pull request #3872 from p12tic/fix-scrollview-double-free (fixes issue #3869)
Fix memory issues in ScrollView::MessageReceiver.
2022-07-18 17:36:04 +02:00
Povilas Kanapickas
0107687a9b viewer: Use std::unique_ptr in event_table_ data structure 2022-07-18 18:04:31 +03:00
Povilas Kanapickas
9a74c4ccad viewer: Use std::unique_ptr in waiting_for_events data structure
The current usage of waiting_for_events is taking ownership of SVEvent
pointer from a unique_ptr. This is error prone as all code paths using
waiting_for_events need to ensure deletion. We fix it by using
unique_ptr in waiting_for_events and all dependent code paths.
2022-07-18 18:04:30 +03:00
Povilas Kanapickas
4f831ff489 viewer: Fix double free caused by ScrollView::MessageReceiver
waiting_for_events takes ownership of the passed event which is later
deleted. Since we use unique_ptr::get() to acquire the pointer, we cause
double free: one free happens in the code path where the event from
waiting_for_events goes and the other free happens in unique_ptr
destructor.

The fix is to move ownership out of unique_ptr by unique_ptr::release().

Fixes: https://github.com/tesseract-ocr/tesseract/issues/3869
Fixes: 37b33749da
2022-07-18 18:04:29 +03:00
Stefan Weil
02e834000c Catch potential nullptr in SVNetwork::SVNetwork
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-07-18 13:52:39 +02:00
Egor Pugin
87dd04fe26
[ci][sw] Disable nightly macos tests. 2022-07-11 19:48:10 +03:00
zdenop
ca9ab49758
Update cmake.yml
clang-11 does not seem to work on macos
2022-07-10 20:34:59 +02:00
Egor Pugin
677f5822f2
Update sw.yml 2022-07-07 20:14:08 +03:00
Stefan Weil
5ad5325a0a Create new release 5.2.0
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-07-06 22:15:49 +02:00
Stefan Weil
b8b6c158a7 Mark parameter 'tessedit_do_invert' as deprecated
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-06-26 19:27:48 +02:00
Stefan Weil
96861b58ae
Add new parameter for invert_threshold (#3852)
Change default value from 0.5 to 0.7.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-06-26 12:32:56 +03:00
Daniel Plakhotich
0df584e65d capi: Fix calling delete[] for memory allocated by malloc 2022-06-23 17:08:45 +02:00
zdenop
38c8c76c34
Merge pull request #3775 from Shreeshrii/disableopenmp
Add benchmark test with disable-openmp
2022-06-23 16:45:23 +02:00
zdenop
dd51e32510
Merge pull request #3682 from leleliu008/improve-build-for-android-integrate-with-cpu_features-library
fix for that motioned in https://github.com/tesseract-ocr/tesseract/issues/3680
2022-06-23 16:44:18 +02:00
zdenop
a96b2abb1a
Merge branch 'main' into improve-build-for-android-integrate-with-cpu_features-library 2022-06-23 16:43:37 +02:00
zdenop
18fb5aa977 fix issue #3092 - skip removing colormap 2022-06-23 16:38:32 +02:00
Stefan Weil
27b1827ccd Update code to support Leptonica 1.83.0 and newer
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-06-23 12:11:00 +02:00
Stefan Weil
70109f1e8f Use Leptonica API to access internals of Pix
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-06-23 11:23:22 +02:00
Nicolas Abram
71b045cf20
C API: Add a function to init tesseract with traineddata from memory (#3780)
Fixes #3691.

* retrigger checks
2022-06-20 14:53:42 +03:00
Amit D
cc06ae456e
Update README.md [skip ci] 2022-06-14 19:01:30 +03:00
Amit D
b5878c23a7
README: Add link to tessdoc/InputFormats
[skip ci]
2022-06-13 18:19:18 +03:00
Stefan Weil
330d49a0a3 Replace BOX -> Box
Both are equivalent, but the rest of the code already uses Box.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-06-10 19:20:19 +02:00
Amit D
395f2315bc
Update README.md
Fix sw status link.
2022-06-10 15:21:51 +03:00
Zdenko Podobný
6bc304d121 Update cmake-win64.yml (D8016: '/Qpar' and '/openmp:llvm' command-line options are incompatible ) 2022-06-08 16:23:49 +02:00
Zdenko Podobný
34cfeafc7f Update cmake-win64.yml 2022-06-08 15:49:58 +02:00
zdenop
2e8ff001e1
Update cmake-win64.yml 2022-06-08 15:31:57 +02:00
zdenop
e3aed54d1d
Update cmake-win64.yml 2022-06-08 15:24:49 +02:00
zdenop
74800c0cc4
Update cmake-win64.yml 2022-06-08 15:15:54 +02:00
Zdenko Podobný
ffb6c09db6 GA: improve cmake-win64: use variable for location, add libarchive build, disabple not need functions 2022-06-08 15:09:15 +02:00
zdenop
67841aa89f do not use '\0' in std::string => fixes issue #3837 (loading uzn file) 2022-06-07 21:31:00 +02:00
Podobny Zdenko
d2015a6119 cmake: fix Build with clang-cl on Windows; fixes #3683 2022-06-07 11:44:29 +02:00
zdenop
d1912d7010
Merge pull request #3835 from Yulv-git/typos1
Fix some typos.
2022-06-05 14:46:17 +02:00
Yulv-git
8bc7a9591d Fix some typos. 2022-06-05 16:48:20 +08:00
Egor Pugin
11796584a2
[sw] Fix macos aarch64 build. 2022-06-03 18:16:36 +03:00
zdenop
554c7ddd93
Update cmake-win64.yml 2022-06-02 20:55:26 +02:00
zdenop
e74f877d5b
Update cmake-win64.yml
test artifact
2022-06-02 20:19:25 +02:00
zdenop
d645a0333f
Update cmake-win64.yml
skip webp build
2022-06-02 14:06:28 +02:00
zdenop
968b6db0b4
Update cmake-win64.yml 2022-06-02 13:27:33 +02:00
Amit D
fdafe6c5b6
Update cmake-win64.yml 2022-06-02 10:07:50 +03:00