when debugging last sources downloaded I noticed that cancelling ocr run (when
importing vobsubs) doesn't stop the tesseract thread
What steps will reproduce the problem?
1. import vobsub
2. use ocr by tesseract
3. start ocr
4. cancel ocr
What is the expected output? What do you see instead?
in the tempdir/ the png files (given to tesseract exe) are still created and
deleted although we have stopped the job
What version of the product are you using? On what operating system?
SE334 on windows 7 x64
Patchs to apply on SE334-CSharp-SourceCode\Forms\VobSubOcr.cs :
private void ButtonStopClick(object sender, EventArgs e)
{
_abort = true;
_tesseractThread.CancelAsync();
buttonStop.Enabled = false;
Application.DoEvents();
progressBar1.Visible = false;
labelStatus.Text = string.Empty;
}
void TesseractThreadDoWork(object sender, DoWorkEventArgs e)
{
var bitmap = (Bitmap)e.Argument;
if (_tesseractAsyncIndex >= 0 && _tesseractAsyncIndex < _tesseractAsyncStrings.Length)
{
if (string.IsNullOrEmpty(_tesseractAsyncStrings[_tesseractAsyncIndex]) && bitmap != null)
_tesseractAsyncStrings[_tesseractAsyncIndex] = Tesseract3DoOcrViaExe(bitmap, _languageId, "-psm 6"); // 6 = Assume a single uniform block of text.);
if (((BackgroundWorker)sender).CancellationPending)
{
e.Cancel = true;
}
}
}
Original issue reported on code.google.com by Me.anouar@gmail.com on 7 May 2013 at 9:38
Original issue reported on code.google.com by
Me.anouar@gmail.com
on 7 May 2013 at 9:38