mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
More OCR selected lines only
This commit is contained in:
parent
d6aa365cc1
commit
d5a6aea3c2
BIN
Ocr/Latin.nocr
BIN
Ocr/Latin.nocr
Binary file not shown.
@ -5211,8 +5211,22 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
}
|
||||
else
|
||||
{
|
||||
_abort = true;
|
||||
SetButtonsEnabledAfterOcrDone();
|
||||
_mainOcrSelectedIndices = null;
|
||||
if (_tesseractThreadRunner != null && (_ocrMethodIndex == _ocrMethodTesseract5 || _ocrMethodIndex == _ocrMethodTesseract302))
|
||||
{
|
||||
for (var i = 0; i < 100; i++)
|
||||
{
|
||||
System.Threading.Thread.Sleep(25);
|
||||
_tesseractThreadRunner.CheckQueue();
|
||||
if (_tesseractThreadRunner.Count == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -80,6 +80,8 @@ namespace Nikse.SubtitleEdit.Logic.Ocr.Tesseract
|
||||
ThreadPool.QueueUserWorkItem(DoOcr, job);
|
||||
}
|
||||
|
||||
public int Count => _jobQueue.Count;
|
||||
|
||||
public void CheckQueue()
|
||||
{
|
||||
lock (QueueLock)
|
||||
|
Loading…
Reference in New Issue
Block a user