Skip to content

Commit 4802442

Browse files
committed
dev
1 parent ab20227 commit 4802442

24 files changed

+1045
-1040
lines changed

.github/workflows/build.yml

+32-18
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ on:
77
pull_request:
88
branches:
99
- '**'
10+
11+
env:
12+
FPC_VER: release_3_2_2
13+
LAZ_VER: lazarus_2_2_4
1014

1115
jobs:
1216
build:
1317
name: ${{ matrix.config.name }}
1418
runs-on: ${{ matrix.config.os }}
15-
defaults:
16-
run:
17-
shell: bash
1819
strategy:
1920
fail-fast: false
2021
matrix:
@@ -45,29 +46,42 @@ jobs:
4546
binary: libsimpleocr64.dylib
4647

4748
steps:
48-
- uses: actions/checkout@v3.0.2
49+
- uses: actions/checkout@v3.5.3
4950

5051
- name: Install Lazarus
51-
uses: ollydev/setup-lazarus-fpcup@v2.5
52+
uses: ollydev/setup-lazarus-fpcup@v3.2
5253
with:
53-
laz-branch: lazarus_2_2_2
54-
fpc-branch: release_3_2_2
55-
fpcup-release: v2.2.0h
54+
laz: ${{ env.LAZ_VER }}
55+
fpc: ${{ env.FPC_VER }}
5656

5757
- name: Build SimpleOCR
5858
run: |
5959
lazbuild --build-mode=${{ matrix.config.build-mode }} SimpleOCR.lpi
6060
61-
- name: Test SimpleOCR
62-
if: matrix.config.name == 'Windows 32'
63-
run: |
64-
unzip -q fonts
65-
cd test
66-
lazbuild tester.lpi
67-
./tester.exe
68-
6961
- name: Upload Binary
70-
uses: actions/upload-artifact@v2.3.1
62+
uses: actions/upload-artifact@v3.1.2
7163
with:
7264
name: ${{ matrix.config.binary }}
73-
path: ${{ matrix.config.binary }}
65+
path: ${{ matrix.config.binary }}
66+
67+
testing:
68+
runs-on: windows-latest
69+
needs: build
70+
steps:
71+
- uses: actions/[email protected]
72+
73+
- name: Install Lazarus
74+
uses: ollydev/[email protected]
75+
with:
76+
laz: ${{ env.LAZ_VER }}
77+
fpc: ${{ env.FPC_VER }}
78+
79+
- name: Build Tester
80+
run: |
81+
cd tester
82+
lazbuild tester.lpi
83+
84+
- name: Run Tests
85+
run: |
86+
cd tester
87+
./tester.exe

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
*.exe
99
backup
1010
lib
11-
/fonts/
11+
/tester/fonts

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,15 @@ function TSimpleOCR.LocateText(Area: TBox; Font: TFontSet; out Bounds: TBox): Si
3535
```
3636
Example:
3737
```pascal
38-
TOCRColorFilter.Create([255]); // Find color red
38+
TOCRColorFilter.Create([$0000FF]); // Find color red
3939
```
4040
![Example](images/filter_color_200.png)
41+
42+
Example with tolerance:
43+
```pascal
44+
TOCRColorFilter.Create([$FFFFFF], [100]); // Find color white with 100 tolerance
45+
```
46+
![Example](images/filter_colortolerance_200.png)
4147

4248
---
4349

SimpleOCR.lpr

+175-200
Large diffs are not rendered by default.

images/filter_colortolerance_200.png

1.49 KB
Loading

simbaplugin.inc

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ begin
3535
end;
3636
end;
3737

38-
procedure addCode(Code: String);
38+
procedure addCode(Code: TStringArray);
3939
begin
40-
SimbaImports.Code := SimbaImports.Code + Code;
40+
SimbaImports.Code := SimbaImports.Code + String.Join(LineEnding, Code);
4141
end;
4242

4343
// Exports

0 commit comments

Comments
 (0)