Skip to content

Commit

Permalink
FIX TESSERACT FR FR NOW
Browse files Browse the repository at this point in the history
  • Loading branch information
Naamloos committed Dec 11, 2023
1 parent f90cf0b commit 746554a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion ModCore/ContextMenu/MessageContextMenu.cs
Expand Up @@ -211,7 +211,10 @@ public async Task TranslateAsync(ContextMenuContext ctx)
{
try
{
using var engine = new TesseractEngine(@"./tessdata_fast", "eng+jpn+rus+jpn_vert", EngineMode.Default);
string pth = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
pth = Path.Combine(pth, "/tessdata_fast");

using var engine = new TesseractEngine(pth, "eng+jpn+rus+jpn_vert", EngineMode.Default);
using var http = new HttpClient();

var img = await http.GetAsync(ctx.TargetMessage.Attachments[0].Url);
Expand Down
4 changes: 2 additions & 2 deletions dockerfile
Expand Up @@ -20,7 +20,7 @@ RUN apk add ffmpeg
RUN apk add tesseract-ocr
RUN apk add leptonica-dev

RUN ln -s /usr/lib/x86_64-linux-gnu/liblept.so.5 liblept.so.5
RUN ln -s /usr/lib/x86_64-linux-gnu/liblept.so.5 libleptonica-1.82.0.so
RUN ln -s /usr/lib/libleptonica.so libleptonica-1.82.0.so
RUN ln -s /usr/lib/libtesseract.so.5 /app/x64/libtesseract50.so

ENTRYPOINT ["dotnet", "/app/ModCore.dll"]

0 comments on commit 746554a

Please sign in to comment.