mirror of
https://github.com/sphildreth/roadie
synced 2024-11-10 06:44:12 +00:00
Update NuGet packages.
This commit is contained in:
parent
67ba43c5d7
commit
7fc99893e3
6 changed files with 50 additions and 42 deletions
|
@ -21,9 +21,9 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.0.0" />
|
||||
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
|
||||
<PackageReference Include="Moq" Version="4.16.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
|
||||
<PackageReference Include="Moq" Version="4.17.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
using SixLabors.ImageSharp.Advanced;
|
||||
using SixLabors.ImageSharp.Processing;
|
||||
using System.IO;
|
||||
using SixLabors.ImageSharp.PixelFormats;
|
||||
using System;
|
||||
|
||||
namespace Roadie.Library.Imaging
|
||||
{
|
||||
|
@ -52,6 +54,8 @@ namespace Roadie.Library.Imaging
|
|||
return count;
|
||||
}
|
||||
|
||||
private static ulong _averageHash = 0;
|
||||
|
||||
#endregion Private constants and utility methods
|
||||
|
||||
#region Public interface methods
|
||||
|
@ -63,16 +67,17 @@ namespace Roadie.Library.Imaging
|
|||
/// <returns>Hash of Image</returns>
|
||||
public static ulong AverageHash(byte[] bytes)
|
||||
{
|
||||
using (var image = sl.Image.Load(bytes))
|
||||
_averageHash = 0;
|
||||
using var image = sl.Image.Load<Rgba32>(bytes);
|
||||
{
|
||||
image.Mutate(ctx => ctx.Resize(8, 8).Grayscale());
|
||||
using (var ms = new MemoryStream())
|
||||
image.ProcessPixelRows(static pixelAccessor =>
|
||||
{
|
||||
var grayscale = new byte[64];
|
||||
uint averageValue = 0;
|
||||
for (var y = 0; y < 8; y++)
|
||||
{
|
||||
var pixelRowSpan = image.GetPixelRowSpan(y);
|
||||
var pixelRowSpan = pixelAccessor.GetRowSpan(y);
|
||||
for (var x = 0; x < 8; x++)
|
||||
{
|
||||
var pixel = pixelRowSpan[x].PackedValue;
|
||||
|
@ -84,15 +89,18 @@ namespace Roadie.Library.Imaging
|
|||
averageValue += gray;
|
||||
}
|
||||
}
|
||||
|
||||
averageValue /= 64;
|
||||
ulong hash = 0;
|
||||
for (var i = 0; i < 64; i++)
|
||||
{
|
||||
if (grayscale[i] >= averageValue)
|
||||
hash |= 1UL << (63 - i);
|
||||
return hash;
|
||||
}
|
||||
{
|
||||
_averageHash |= 1UL << (63 - i);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
return _averageHash;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -12,22 +12,22 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="AutoCompare.Core" Version="1.0.0" />
|
||||
<PackageReference Include="CsvHelper" Version="27.2.1" />
|
||||
<PackageReference Include="EFCore.BulkExtensions" Version="6.3.0" />
|
||||
<PackageReference Include="FluentFTP" Version="36.1.0" />
|
||||
<PackageReference Include="EFCore.BulkExtensions" Version="6.4.1" />
|
||||
<PackageReference Include="FluentFTP" Version="37.0.2" />
|
||||
<PackageReference Include="Hashids.net" Version="1.4.1" />
|
||||
<PackageReference Include="Hqub.Last.fm" Version="2.1.0" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.40" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.42" />
|
||||
<PackageReference Include="IdSharp.Common" Version="1.0.1" />
|
||||
<PackageReference Include="IdSharp.Tagging" Version="1.0.0-rc3" />
|
||||
<PackageReference Include="Inflatable.Lastfm" Version="1.2.0" />
|
||||
<PackageReference Include="LiteDB" Version="5.0.11" />
|
||||
<PackageReference Include="Magick.NET-Q16-x64" Version="8.6.1" />
|
||||
<PackageReference Include="Mapster" Version="7.2.0" />
|
||||
<PackageReference Include="Magick.NET-Q16-x64" Version="10.0.0" />
|
||||
<PackageReference Include="Mapster" Version="7.3.0" />
|
||||
<PackageReference Include="MetadataExtractor" Version="2.7.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Redis" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
|
||||
|
@ -37,9 +37,9 @@
|
|||
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.1" />
|
||||
<PackageReference Include="MimeMapping" Version="1.0.1.37" />
|
||||
<PackageReference Include="NodaTime" Version="3.0.9" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0" />
|
||||
<PackageReference Include="RestSharp" Version="107.1.1" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1" />
|
||||
<PackageReference Include="RestSharp" Version="107.3.0" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="2.0.0" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
|
||||
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
|
||||
<PackageReference Include="System.Runtime.Caching" Version="6.0.0" />
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Hashids.net" Version="1.4.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.15.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.15" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.16.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.17" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -30,31 +30,31 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BCrypt-Core" Version="2.0.0" />
|
||||
<PackageReference Include="Mapster" Version="7.2.0" />
|
||||
<PackageReference Include="Mapster" Version="7.3.0" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.20.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic" Version="4.0.1" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.0.1" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.0.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic" Version="4.1.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.1.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.2" />
|
||||
<PackageReference Include="Pastel" Version="3.0.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
|
||||
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.0" />
|
||||
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
|
||||
<PackageReference Include="Serilog.Exceptions" Version="8.0.0" />
|
||||
<PackageReference Include="Serilog.Exceptions" Version="8.1.0" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
|
||||
<PackageReference Include="Serilog.Sinks.LiteDB.NetStandard" Version="1.0.14" />
|
||||
<PackageReference Include="Serilog.Sinks.RollingFileAlternate" Version="2.0.9" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.15.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.15" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.16.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.17" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
Loading…
Reference in a new issue