Skip to content

Commit

Permalink
Updated projects and readme in prep for release
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesw committed Nov 15, 2020
1 parent 061a5c6 commit ff22dc4
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 21 deletions.
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/Tesseract.NetCore2Tests/bin/Debug/netcoreapp3.1/Tesseract.NetCore31Tests.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Tesseract.NetCore2Tests",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
42 changes: 42 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/Tesseract.NetCore2Tests/Tesseract.NetCore31Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/src/Tesseract.NetCore2Tests/Tesseract.NetCore31Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/src/Tesseract.NetCore2Tests/Tesseract.NetCore31Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}
12 changes: 11 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
### Version 4.1.0
### Version 4.1.1

* Upgraded to Tesseract 4.1.1 [Issue 528](https://github.com/charlesw/tesseract/issues/528)
* Fixed Interop.TessApi.BaseApiGetVersion [Issue 522](https://github.com/charlesw/tesseract/issues/522)

#### Known issues

* Setting regions of interest doesn't work [Issue 489](https://github.com/charlesw/tesseract/issues/489)
* PageSegMode.SingleBlockVertText does not work [Issue 490](https://github.com/charlesw/tesseract/issues/490)

### Version 4.1.0

Note: As of version 4.1.0 this wrapper will now match Tesseract's version to the first two numbers
(Major.Minor) with the last number (Patch) reserved for changes in the wrapper. This is to avoid
Expand Down
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
A .NET wrapper for [tesseract-ocr] 4.1.0.
A .NET wrapper for [tesseract-ocr] 4.1.1.

## Dependencies

Expand Down
4 changes: 2 additions & 2 deletions src/Tesseract.Drawing/Tesseract.Drawing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Company />
<Product>Tesseract.Drawing</Product>
<Description>Adds support for interop with System.Drawing to Tesseract such as passing Bitmap to Tesseract.</Description>
<Copyright>Copyright 2019 Charles Weld</Copyright>
<Copyright>Copyright 2019-2020 Charles Weld</Copyright>
<PackageReleaseNotes>https://github.com/charlesw/tesseract/blob/master/ChangeLog.md</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/charlesw/tesseract/</PackageProjectUrl>
<RepositoryUrl>https://github.com/charlesw/tesseract/</RepositoryUrl>
Expand All @@ -35,7 +35,7 @@


<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
<PackageReference Include="System.Drawing.Common" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Tesseract.Net45Tests/Tesseract.Net45Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Tesseract.Tests/BaseApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Tesseract.Tests
public class BaseApiTests
{
[Test]
public void GetVersion_Is410()
public void CanGetVersion()
{
var version = Interop.TessApi.BaseApiGetVersion();
Assert.That(version, Does.StartWith("4.1.1"));
Expand Down
9 changes: 9 additions & 0 deletions src/Tesseract.Tests/EngineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ public class EngineTests : TesseractTestBase
{
private const string TestImagePath = "Ocr/phototest.tif";

[Test]
public void CanGetVersion()
{
using (var engine = CreateEngine())
{
Assert.That(engine.Version, Does.StartWith("4.1.1"));
}
}

[Test]
public void CanParseMultipageTif()
{
Expand Down
11 changes: 5 additions & 6 deletions src/Tesseract/Tesseract.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45;net40</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net40;net45</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -10,20 +10,19 @@
<Company />
<Product>Tesseract</Product>
<Description>Tesseract 4 adds a new neural net (LSTM) based OCR engine which is focused on line recognition, but also still supports the legacy Tesseract OCR engine of Tesseract 3 which works by recognizing character patterns. Compatibility with Tesseract 3 is enabled by using the Legacy OCR Engine mode (--oem 0). It also needs traineddata files which support the legacy engine, for example those from the tessdata repository.</Description>
<Copyright>Copyright 2012-2019 Charles Weld</Copyright>
<Copyright>Copyright 2012-2020 Charles Weld</Copyright>
<PackageReleaseNotes>https://github.com/charlesw/tesseract/blob/master/ChangeLog.md</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/charlesw/tesseract/</PackageProjectUrl>
<RepositoryUrl>https://github.com/charlesw/tesseract/</RepositoryUrl>
<PackageTags>Tesseract Ocr</PackageTags>
<Version>4.1.1-beta1</Version>
<Version>4.1.1</Version>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<NeutralLanguage></NeutralLanguage>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
</PropertyGroup>

<!-- .NET 4.0 references, compilation flags and build options -->
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40'">
<DefineConstants>NET40;NETFULL;SYSTEM_DRAWING_SUPPORT</DefineConstants>
<DefineConstants>NET40;NETFULL;SYSTEM_DRAWING_SUPPORT</DefineConstants>
</PropertyGroup>

<!-- .NET 4.5 references, compilation flags and build options -->
Expand All @@ -43,7 +42,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Reflection.Emit">
<Version>4.3.0</Version>
<Version>4.7.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/Tesseract/Tesseract.targets
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)\..\x86\leptonica-1.78.0.dll">
<Link>x86\leptonica-1.79.0.dll</Link>
<None Include="$(MSBuildThisFileDirectory)\..\x86\leptonica-1.80.0.dll">
<Link>x86\leptonica-1.80.0.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)\..\x86\tesseract41.dll">
<Link>x86\tesseract41.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)\..\x64\leptonica-1.78.0.dll">
<Link>x64\leptonica-1.79.0.dll</Link>
<None Include="$(MSBuildThisFileDirectory)\..\x64\leptonica-1.80.0.dll">
<Link>x64\leptonica-1.80.0.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)\..\x64\tesseract41.dll">
Expand Down
6 changes: 2 additions & 4 deletions src/Tesseract/TesseractEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Runtime.InteropServices;
using System.Security;
using Tesseract.Internal;
using Tesseract.Interop;

namespace Tesseract
{
Expand All @@ -13,7 +14,6 @@ namespace Tesseract
/// </summary>
public class TesseractEngine : DisposableBase
{
private const string TesseractVersion = "4.1.0.00";
private static readonly TraceSource trace = new TraceSource("Tesseract");

private HandleRef handle;
Expand Down Expand Up @@ -189,9 +189,7 @@ public string Version
{
// Get version doesn't work for x64, might be compilation related for now just
// return constant so we don't crash.
return TesseractVersion;

// return Interop.TessApi.Native.GetVersion();
return TessApi.BaseApiGetVersion();
}
}

Expand Down

0 comments on commit ff22dc4

Please sign in to comment.