mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
Fix for BUG-1884, added a trim call for the scanned text
This commit is contained in:
parent
199401f2f1
commit
6924495471
2 changed files with 9 additions and 1 deletions
|
@ -40,7 +40,12 @@ namespace GreenshotOCRCommand {
|
||||||
modiDocument.OCR(language, orientimage, straightenImage);
|
modiDocument.OCR(language, orientimage, straightenImage);
|
||||||
IImage modiImage = modiDocument.Images[0];
|
IImage modiImage = modiDocument.Images[0];
|
||||||
ILayout layout = modiImage.Layout;
|
ILayout layout = modiImage.Layout;
|
||||||
Console.WriteLine(layout.Text);
|
if (layout.Text != null)
|
||||||
|
{
|
||||||
|
// For for BUG-1884:
|
||||||
|
// Although this is done in the OCR Plugin, it does make sense in the command too.
|
||||||
|
Console.WriteLine(layout.Text.Trim());
|
||||||
|
}
|
||||||
modiDocument.Close(false);
|
modiDocument.Close(false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,6 +202,9 @@ namespace GreenshotOCR {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For for BUG-1884:
|
||||||
|
text = text.Trim();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
LOG.DebugFormat("Pasting OCR Text to Clipboard: {0}", text);
|
LOG.DebugFormat("Pasting OCR Text to Clipboard: {0}", text);
|
||||||
// Paste to Clipboard (the Plugin currently doesn't have access to the ClipboardHelper from Greenshot
|
// Paste to Clipboard (the Plugin currently doesn't have access to the ClipboardHelper from Greenshot
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue