Skip to content

Commit

Permalink
v4.0.7 GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
Decimation committed Dec 31, 2024
1 parent bfbc83e commit 07d2d09
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 12 deletions.
5 changes: 3 additions & 2 deletions SmartImage.Lib/Images/Uni/UniImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Novus.Win32;
using CoenM.ImageHash.HashAlgorithms;
using CoenM.ImageHash;
using Kantan.Diagnostics;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Png;
Expand Down Expand Up @@ -347,7 +348,7 @@ protected string WriteStreamToFile(string fn = null)

public virtual void Dispose()
{
Trace.WriteLine($"Disposing {ValueString} w/ {Size}");
Trace.WriteLine($"Disposing {ValueString} w/ {Size}", LogCategories.C_VERBOSE);
Stream?.Dispose();
Image?.Dispose();

Expand All @@ -357,7 +358,7 @@ public virtual void Dispose()

public virtual async ValueTask DisposeAsync()
{
Trace.WriteLine($"Disposing {ValueString} w/ {Size}");
Trace.WriteLine($"Disposing {ValueString} w/ {Size}", LogCategories.C_VERBOSE);

if (Stream != null)
await Stream.DisposeAsync();
Expand Down
5 changes: 3 additions & 2 deletions SmartImage.Lib/Images/Uni/UniImageUri.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ string s when Url.IsValid(s) => s,

var scheme = u.Scheme;

return Schemes.All(s => scheme != s);
return LegalSchemes.Contains(scheme);
}

public override async ValueTask<bool> AllocAsync(CancellationToken ct = default)
Expand All @@ -64,7 +64,8 @@ public async ValueTask<bool> AllocResponseAsync(CancellationToken ct = default)
return HasResponse;
}

public static readonly string[] Schemes = ["file", "javascript"];
public static readonly List<string> RestrictedSchemes = ["file", "javascript", "cpu"];
public static readonly List<string> LegalSchemes = ["http", "https"];

public static async ValueTask<IFlurlResponse> GetResponseAsync(Url value, CancellationToken ct)
{
Expand Down
3 changes: 2 additions & 1 deletion SmartImage.Lib/Results/SearchResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Threading.Channels;
using AngleSharp.Html.Parser;
using Flurl.Http;
using Kantan.Diagnostics;
using Kantan.Net.Utilities;
using SmartImage.Lib.Engines;
using SmartImage.Lib.Images;
Expand Down Expand Up @@ -193,7 +194,7 @@ public override string ToString()

public void Dispose()
{
Debug.WriteLine($"Disposing {Engine.Name} with {Results.Count}");
Debug.WriteLine($"Disposing {Engine.Name} with {Results.Count}", LogCategories.C_VERBOSE);

foreach (SearchResultItem item in Results) {
item.Dispose();
Expand Down
5 changes: 3 additions & 2 deletions SmartImage.Lib/SmartImage.Lib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
<DefineConstants>DEBUG;TRACE;JETBRAINS_ANNOTATIONS;TEST</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AngleSharp" Version="1.1.2" />
<PackageReference Include="AngleSharp" Version="1.2.0" />
<PackageReference Include="AngleSharp.Css" Version="1.0.0-alpha-99" />
<PackageReference Include="AngleSharp.Io" Version="1.0.0" />
<PackageReference Include="AngleSharp.Js" Version="0.15.0" />
<PackageReference Include="AngleSharp.XPath" Version="2.0.4" />
<PackageReference Include="CliWrap" Version="3.7.0" />
<PackageReference Include="CoenM.ImageSharp.ImageHash" Version="1.3.6" />
Expand All @@ -62,9 +61,11 @@
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Validation" Version="17.8.8" />
<PackageReference Include="Microsoft.Win32.Primitives" Version="4.3.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.0" />
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
<PackageReference Include="System.Net.Primitives" Version="4.3.1" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
<PackageReference Include="System.Runtime.Caching" Version="9.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
Expand Down
2 changes: 2 additions & 0 deletions SmartImage.Rdx/SmartImage.Rdx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="8.0.0-preview.7.23375.6" />
<PackageReference Include="Microsoft.VisualStudio.Validation" Version="17.8.8" />
<PackageReference Include="Microsoft.Win32.Primitives" Version="4.3.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
<PackageReference Include="Spectre.Console" Version="0.49.1" />
<PackageReference Include="Spectre.Console.Analyzer" Version="1.0.0">
Expand All @@ -71,6 +72,7 @@
<PackageReference Include="Spectre.Console.Cli" Version="0.49.1" />
<PackageReference Include="Spectre.Console.ImageSharp" Version="0.49.1" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.0" />
<PackageReference Include="System.Net.Primitives" Version="4.3.1" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
<PackageReference Include="Verify.Flurl" Version="1.0.0" />
Expand Down
6 changes: 2 additions & 4 deletions SmartImage.UI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
using Flurl.Http;
using SmartImage.UI.Model;
using Color = System.Drawing.Color;
using Jint.Parser.Ast;
// using Jint.Parser.Ast;
using Novus.Win32;
using Novus.Win32.Structures.Kernel32;
using CancellationTokenSource = System.Threading.CancellationTokenSource;
Expand Down Expand Up @@ -205,7 +205,7 @@ public MainWindow()

public static SearchEngineOptions[] Engines { get; } = Enum.GetValues<SearchEngineOptions>();

private readonly object m_lock = new();
private readonly Lock m_lock = new();

private readonly WindowInteropHelper m_wndInterop;

Expand Down Expand Up @@ -659,7 +659,6 @@ private void ClipboardListenAsync(object? s, EventArgs e)
AddToQueue(fn);

}

else if (cText) {
string? txt = (string) Clipboard.GetData(DataFormats.UnicodeText);
txt = txt.CleanString();
Expand All @@ -680,7 +679,6 @@ private void ClipboardListenAsync(object? s, EventArgs e)
}

}

else if (cFile) {
var files = Clipboard.GetFileDropList();
var rg = new string[files.Count];
Expand Down
4 changes: 3 additions & 1 deletion SmartImage.UI/SmartImage.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<AssemblyName>SmartImage</AssemblyName>
<ApplicationIcon>Icon.ico</ApplicationIcon>
<FileVersion></FileVersion>
<AssemblyVersion>4.0.6.0</AssemblyVersion>
<AssemblyVersion>4.0.7.0</AssemblyVersion>
<NoWarn>IDE0290</NoWarn>
<EnableSourceControlManagerQueries>True</EnableSourceControlManagerQueries>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
Expand Down Expand Up @@ -70,9 +70,11 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="Microsoft.Win32.Primitives" Version="4.3.0" />
<!-- <PackageReference Include="ReactiveUI.WPF" Version="20.1.63" /> -->
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
<PackageReference Include="System.Net.Primitives" Version="4.3.1" />
<PackageReference Include="System.Security.Cryptography.X509Certificates" Version="4.3.2" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
<PackageReference Include="Verify.Flurl" Version="1.0.0" />
Expand Down

0 comments on commit 07d2d09

Please sign in to comment.