mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Added additional guards and a configuration for the Win10 plugin, which disables the OCR by default.
This commit is contained in:
parent
6a09345649
commit
d602433c53
3 changed files with 19 additions and 8 deletions
|
@ -42,13 +42,13 @@ namespace GreenshotPicasaPlugin {
|
|||
set;
|
||||
}
|
||||
|
||||
[IniProperty("UploadUser", Description = "The picasa user to upload to", DefaultValue = "default")]
|
||||
[IniProperty("UploadUser", Description = "The Picasa user to upload to", DefaultValue = "default")]
|
||||
public string UploadUser {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[IniProperty("UploadAlbum", Description = "The picasa album to upload to", DefaultValue = "default")]
|
||||
[IniProperty("UploadAlbum", Description = "The Picasa album to upload to", DefaultValue = "default")]
|
||||
public string UploadAlbum {
|
||||
get;
|
||||
set;
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace GreenshotPlugin.Core {
|
|||
return 1;
|
||||
}
|
||||
if (Priority == other.Priority) {
|
||||
return Description.CompareTo(other.Description);
|
||||
return string.Compare(Description, other.Description, StringComparison.Ordinal);
|
||||
}
|
||||
return Priority - other.Priority;
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
using System.Threading.Tasks;
|
||||
using GreenshotPlugin.Core;
|
||||
using GreenshotPlugin.IniFile;
|
||||
using GreenshotPlugin.Interfaces;
|
||||
using GreenshotPlugin.Interfaces.Ocr;
|
||||
|
||||
|
@ -29,13 +30,23 @@ namespace GreenshotWin10Plugin.Processors {
|
|||
/// This processor processes a capture to see if there is text on it
|
||||
/// </summary>
|
||||
public class Win10OcrProcessor : AbstractProcessor {
|
||||
private static readonly Win10Configuration Win10Configuration = IniConfig.GetIniSection<Win10Configuration>();
|
||||
public override string Designation => "Windows10OcrProcessor";
|
||||
|
||||
public override string Description => Designation;
|
||||
|
||||
public override bool ProcessCapture(ISurface surface, ICaptureDetails captureDetails)
|
||||
{
|
||||
if (captureDetails.OcrInformation != null)
|
||||
if (!Win10Configuration.AlwaysRunOCROnCapture)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (surface == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (captureDetails == null || captureDetails.OcrInformation != null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue