Skip to content

Commit

Permalink
fix TesseractOCR undisposed error
Browse files Browse the repository at this point in the history
  • Loading branch information
imba-tjd committed Feb 14, 2023
1 parent 2a16cf0 commit bb3d3d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion OCRLibrary/TesseractOCR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ public override Task<string> OCRProcessAsync(Bitmap img)
var pix = tesseract.Pix.Image.LoadFromMemory(stream);

var recog = engine.Process(pix);
string text = recog.Text;
stream.Dispose();
return Task.FromResult(recog.Text);
recog.Dispose();

return Task.FromResult(text);
}
catch (Exception ex)
{
Expand Down

0 comments on commit bb3d3d1

Please sign in to comment.