mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Fixed a typo
Fixed #218 Added JPEG (vs JPG) as a format which can be handled Updated dependencies
This commit is contained in:
parent
5db1f5564b
commit
6a09345649
5 changed files with 19 additions and 8 deletions
|
@ -17,7 +17,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Tools.InnoSetup" version="6.0.4" GeneratePathProperty="true" />
|
<PackageReference Include="Tools.InnoSetup" version="6.0.5" GeneratePathProperty="true" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\GreenshotPlugin\GreenshotPlugin.csproj" />
|
<ProjectReference Include="..\GreenshotPlugin\GreenshotPlugin.csproj" />
|
||||||
<PackageReference Include="Dapplo.Jira" version="0.9.21" />
|
<PackageReference Include="Dapplo.Jira" version="0.9.28" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -49,6 +49,7 @@ namespace GreenshotPlugin.Core {
|
||||||
private static readonly string FORMAT_PNG_OFFICEART = "PNG+Office Art";
|
private static readonly string FORMAT_PNG_OFFICEART = "PNG+Office Art";
|
||||||
private static readonly string FORMAT_17 = "Format17";
|
private static readonly string FORMAT_17 = "Format17";
|
||||||
private static readonly string FORMAT_JPG = "JPG";
|
private static readonly string FORMAT_JPG = "JPG";
|
||||||
|
private static readonly string FORMAT_JPEG = "JPEG";
|
||||||
private static readonly string FORMAT_JFIF = "JFIF";
|
private static readonly string FORMAT_JFIF = "JFIF";
|
||||||
private static readonly string FORMAT_JFIF_OFFICEART = "JFIF+Office Art";
|
private static readonly string FORMAT_JFIF_OFFICEART = "JFIF+Office Art";
|
||||||
private static readonly string FORMAT_GIF = "GIF";
|
private static readonly string FORMAT_GIF = "GIF";
|
||||||
|
@ -253,7 +254,9 @@ EndSelection:<<<<<<<4
|
||||||
|| dataObject.GetDataPresent(FORMAT_PNG)
|
|| dataObject.GetDataPresent(FORMAT_PNG)
|
||||||
|| dataObject.GetDataPresent(FORMAT_17)
|
|| dataObject.GetDataPresent(FORMAT_17)
|
||||||
|| dataObject.GetDataPresent(FORMAT_JPG)
|
|| dataObject.GetDataPresent(FORMAT_JPG)
|
||||||
|| dataObject.GetDataPresent(FORMAT_GIF)) {
|
|| dataObject.GetDataPresent(FORMAT_JFIF)
|
||||||
|
|| dataObject.GetDataPresent(FORMAT_JPEG)
|
||||||
|
|| dataObject.GetDataPresent(FORMAT_GIF)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
var imageFiles = GetImageFilenames(dataObject);
|
var imageFiles = GetImageFilenames(dataObject);
|
||||||
|
@ -345,9 +348,9 @@ EndSelection:<<<<<<<4
|
||||||
if (formats != null && formats.Contains(FORMAT_PNG_OFFICEART) && formats.Contains(DataFormats.Dib)) {
|
if (formats != null && formats.Contains(FORMAT_PNG_OFFICEART) && formats.Contains(DataFormats.Dib)) {
|
||||||
// Outlook ??
|
// Outlook ??
|
||||||
Log.Info("Most likely the current clipboard contents come from Outlook, as this has a problem with PNG and others we place the DIB format to the front...");
|
Log.Info("Most likely the current clipboard contents come from Outlook, as this has a problem with PNG and others we place the DIB format to the front...");
|
||||||
retrieveFormats = new[] { DataFormats.Dib, FORMAT_BITMAP, FORMAT_FILECONTENTS, FORMAT_PNG_OFFICEART, FORMAT_PNG, FORMAT_JFIF_OFFICEART, FORMAT_JPG, FORMAT_JFIF, DataFormats.Tiff, FORMAT_GIF };
|
retrieveFormats = new[] { DataFormats.Dib, FORMAT_BITMAP, FORMAT_FILECONTENTS, FORMAT_PNG_OFFICEART, FORMAT_PNG, FORMAT_JFIF_OFFICEART, FORMAT_JPG, FORMAT_JPEG, FORMAT_JFIF, DataFormats.Tiff, FORMAT_GIF };
|
||||||
} else {
|
} else {
|
||||||
retrieveFormats = new[] { FORMAT_PNG_OFFICEART, FORMAT_PNG, FORMAT_17, FORMAT_JFIF_OFFICEART, FORMAT_JPG, FORMAT_JFIF, DataFormats.Tiff, DataFormats.Dib, FORMAT_BITMAP, FORMAT_FILECONTENTS, FORMAT_GIF };
|
retrieveFormats = new[] { FORMAT_PNG_OFFICEART, FORMAT_PNG, FORMAT_17, FORMAT_JFIF_OFFICEART, FORMAT_JPG, FORMAT_JPEG, FORMAT_JFIF, DataFormats.Tiff, DataFormats.Dib, FORMAT_BITMAP, FORMAT_FILECONTENTS, FORMAT_GIF };
|
||||||
}
|
}
|
||||||
foreach (string currentFormat in retrieveFormats) {
|
foreach (string currentFormat in retrieveFormats) {
|
||||||
if (formats != null && formats.Contains(currentFormat)) {
|
if (formats != null && formats.Contains(currentFormat)) {
|
||||||
|
@ -700,7 +703,7 @@ EndSelection:<<<<<<<4
|
||||||
//now copy to clipboard
|
//now copy to clipboard
|
||||||
IDataObject dataObj = new DataObject();
|
IDataObject dataObj = new DataObject();
|
||||||
dataObj.SetData(format.Name, false, obj);
|
dataObj.SetData(format.Name, false, obj);
|
||||||
// Use false to make the object dissapear when the application stops.
|
// Use false to make the object disappear when the application stops.
|
||||||
SetDataObject(dataObj, true);
|
SetDataObject(dataObj, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.10.9" />
|
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="1.0.3" />
|
||||||
<PackageReference Include="log4net" version="2.0.8" />
|
<PackageReference Include="log4net" version="2.0.8" />
|
||||||
<PackageReference Include="Svg" Version="3.1.1" />
|
<PackageReference Include="Svg" Version="3.1.1" />
|
||||||
<Reference Include="Accessibility" />
|
<Reference Include="Accessibility" />
|
||||||
|
|
|
@ -41,9 +41,17 @@ namespace GreenshotWin10Plugin.Processors {
|
||||||
}
|
}
|
||||||
var ocrProvider = SimpleServiceProvider.Current.GetInstance<IOcrProvider>();
|
var ocrProvider = SimpleServiceProvider.Current.GetInstance<IOcrProvider>();
|
||||||
|
|
||||||
|
if (ocrProvider == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
var ocrResult = Task.Run(async () => await ocrProvider.DoOcrAsync(surface)).Result;
|
var ocrResult = Task.Run(async () => await ocrProvider.DoOcrAsync(surface)).Result;
|
||||||
|
|
||||||
if (!ocrResult.HasContent) return false;
|
if (!ocrResult.HasContent)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
captureDetails.OcrInformation = ocrResult;
|
captureDetails.OcrInformation = ocrResult;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue