diff --git a/GreenshotOCRCommand/Program.cs b/GreenshotOCRCommand/Program.cs index 1975e451c..eb8033856 100644 --- a/GreenshotOCRCommand/Program.cs +++ b/GreenshotOCRCommand/Program.cs @@ -40,7 +40,12 @@ namespace GreenshotOCRCommand { modiDocument.OCR(language, orientimage, straightenImage); IImage modiImage = modiDocument.Images[0]; 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); return 0; } diff --git a/GreenshotOCRPlugin/OCRPlugin.cs b/GreenshotOCRPlugin/OCRPlugin.cs index 60313cbd6..29663f698 100644 --- a/GreenshotOCRPlugin/OCRPlugin.cs +++ b/GreenshotOCRPlugin/OCRPlugin.cs @@ -202,6 +202,9 @@ namespace GreenshotOCR { return null; } + // For for BUG-1884: + text = text.Trim(); + try { LOG.DebugFormat("Pasting OCR Text to Clipboard: {0}", text); // Paste to Clipboard (the Plugin currently doesn't have access to the ClipboardHelper from Greenshot