mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
[TextExtractor]Check for CJK Language before combining OCR result to string (#20415)
This commit is contained in:
@@ -136,6 +136,8 @@ internal class ImageMethods
|
||||
OcrResult ocrResult = await ocrEngine.RecognizeAsync(softwareBmp);
|
||||
|
||||
if (singlePoint == null)
|
||||
{
|
||||
if (isCJKLang == false)
|
||||
{
|
||||
foreach (OcrLine line in ocrResult.Lines)
|
||||
{
|
||||
@@ -143,6 +145,19 @@ internal class ImageMethods
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (OcrLine ocrLine in ocrResult.Lines)
|
||||
{
|
||||
foreach (OcrWord ocrWord in ocrLine.Words)
|
||||
{
|
||||
_ = text.Append(ocrWord.Text);
|
||||
}
|
||||
|
||||
text.Append(Environment.NewLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Windows.Foundation.Point fPoint = new Windows.Foundation.Point(singlePoint.Value.X, singlePoint.Value.Y);
|
||||
foreach (OcrLine ocrLine in ocrResult.Lines)
|
||||
|
||||
Reference in New Issue
Block a user