Skip to content

Commit b2d2671

Browse files
authored
Update to ImageSharp 1.0.4 (#39)
1 parent 799838e commit b2d2671

File tree

11 files changed

+129
-34
lines changed

11 files changed

+129
-34
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: nuget
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
target-branch: "develop"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: on-push-do-docs
2+
on:
3+
push:
4+
jobs:
5+
docs:
6+
runs-on: windows-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Run MarkdownSnippets
10+
run: |
11+
dotnet tool install --global MarkdownSnippets.Tool
12+
mdsnippets ${GITHUB_WORKSPACE}
13+
shell: bash
14+
- name: Push changes
15+
run: |
16+
git config --local user.email "[email protected]"
17+
git config --local user.name "GitHub Action"
18+
git commit -m "Docs changes" -a || echo "nothing to commit"
19+
remote="https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git"
20+
branch="${GITHUB_REF:11}"
21+
git push "${remote}" ${branch} || echo "nothing to push"
22+
shell: bash
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: on-push-do-test
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- feature/*
8+
- release/*
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
os: [windows-latest, ubuntu-latest, macos-latest]
15+
runs-on: ${{ matrix.os }}
16+
17+
steps:
18+
19+
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0 # avoid shallow clone
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v1
25+
with:
26+
dotnet-version: 2.1.x
27+
28+
- name: Setup .NET
29+
uses: actions/setup-dotnet@v1
30+
with:
31+
dotnet-version: 3.1.x
32+
33+
- name: Setup .NET
34+
uses: actions/setup-dotnet@v1
35+
with:
36+
dotnet-version: 5.0.x
37+
38+
- name: Setup .NET
39+
uses: actions/setup-dotnet@v1
40+
with:
41+
dotnet-version: 6.0.x
42+
include-prerelease: true
43+
44+
- name: Remove demo project from solution
45+
run: dotnet sln ImageHash.sln remove demo/Demo.csproj
46+
47+
- name: Restore dependencies
48+
run: dotnet restore
49+
50+
- name: Build
51+
run: dotnet build --no-restore
52+
53+
- name: Test
54+
run: dotnet test --no-build --verbosity normal

Directory.Build.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,15 @@
22
<Project>
33
<PropertyGroup>
44
<LangVersion>latest</LangVersion>
5+
6+
<!-- Set the CheckEolTargetFramework property to false. This will remove the following warning:
7+
The target framework 'netcoreapp2.1' is out of support and will not receive security updates in the future. -->
8+
<CheckEolTargetFramework>false</CheckEolTargetFramework>
59
</PropertyGroup>
10+
11+
<Target Name="PrepareReleaseNotes" BeforeTargets="GenerateNuspec" DependsOnTargets="GetVersion">
12+
<PropertyGroup>
13+
<PackageReleaseNotes>$(PackageProjectUrl)releases/tag/v$(Version)</PackageReleaseNotes>
14+
</PropertyGroup>
15+
</Target>
616
</Project>

ImageHash.sln

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30413.136
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageHash", "src\ImageHash\ImageHash.csproj", "{466FAF4C-F68A-441A-AA13-4A2F061AD478}"
77
EndProject
@@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1515
Directory.Build.props = Directory.Build.props
1616
Directory.Build.targets = Directory.Build.targets
1717
GitVersion.yml = GitVersion.yml
18+
build\Packages.targets = build\Packages.targets
1819
EndProjectSection
1920
EndProject
2021
Global

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ using var stream = File.OpenRead(filename);
5454

5555
ulong imageHash = hashAlgorithm.Hash(stream);
5656
```
57-
<sup><a href='/tests/ImageHash.Test/Examples.cs#L12-L24' title='File snippet `calculateimagehash` was extracted from'>snippet source</a> | <a href='#snippet-calculateimagehash' title='Navigate to start of snippet `calculateimagehash`'>anchor</a></sup>
57+
<sup><a href='/tests/ImageHash.Test/Examples.cs#L15-L27' title='Snippet source file'>snippet source</a> | <a href='#snippet-calculateimagehash' title='Start of snippet'>anchor</a></sup>
5858
<!-- endSnippet -->
5959

6060
### Calculate image similarity
@@ -69,7 +69,7 @@ ulong hash2 = hashAlgorithm.Hash(imageStream2);
6969

7070
double percentageImageSimilarity = CompareHash.Similarity(hash1, hash2);
7171
```
72-
<sup><a href='/tests/ImageHash.Test/Examples.cs#L33-L41' title='File snippet `calculatesimilarity` was extracted from'>snippet source</a> | <a href='#snippet-calculatesimilarity' title='Navigate to start of snippet `calculatesimilarity`'>anchor</a></sup>
72+
<sup><a href='/tests/ImageHash.Test/Examples.cs#L36-L44' title='Snippet source file'>snippet source</a> | <a href='#snippet-calculatesimilarity' title='Start of snippet'>anchor</a></sup>
7373
<!-- endSnippet -->
7474

7575
You can also take a look at [DotNet APIs](http://dotnetapis.com/pkg/CoenM.ImageSharp.ImageHash).

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ environment:
88

99
image:
1010
- Ubuntu
11-
- Visual Studio 2019
11+
- Visual Studio 2022
1212

1313
configuration: Debug
1414

build/Packages.targets

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<PrivateAssets>all</PrivateAssets>
88
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
99
</PackageReference>
10-
11-
<PackageReference Include="GitVersionTask" Version="5.3.7">
10+
11+
<PackageReference Include="GitVersion.MsBuild" Version="5.7.0">
1212
<PrivateAssets>all</PrivateAssets>
1313
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1414
</PackageReference>
@@ -18,14 +18,13 @@
1818
<ItemGroup>
1919

2020
<!--Dependencies production code (and maybe also in test code)-->
21-
<PackageReference Update="SixLabors.ImageSharp" Version="1.0.1" />
21+
<PackageReference Update="SixLabors.ImageSharp" Version="1.0.4" />
2222

2323
<!-- Packages and tools for releasing (sourcelink)-->
24-
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
25-
<PackageReference Update="MarkdownSnippets.MsBuild" Version="21.0.1" />
24+
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
2625

2726
<!--Required in test project -->
28-
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.1.1" />
27+
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.0.0" />
2928

3029
<!-- xunit -->
3130
<PackageReference Update="xunit" Version="2.4.1" />
@@ -37,22 +36,24 @@
3736
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.3" />
3837

3938
<!-- Unittesting -->
40-
<PackageReference Update="FakeItEasy" Version="6.2.0" />
41-
<PackageReference Update="FakeItEasy.Analyzer.CSharp" Version="6.0.0" />
42-
<PackageReference Update="FluentAssertions" Version="5.10.3" />
39+
<PackageReference Update="FakeItEasy" Version="7.2.0" />
40+
<PackageReference Update="FakeItEasy.Analyzer.CSharp" Version="6.1.0" />
41+
<PackageReference Update="FluentAssertions" Version="6.2.0" />
4342
<PackageReference Update="FluentAssertions.Analyzers" Version="0.11.4" />
43+
<PackageReference Update="EasyTestFile" Version="1.0.2" />
44+
<PackageReference Update="EasyTestFile.XUnit" Version="1.0.2" />
4445

4546
<!-- Test coverage -->
4647
<PackageReference Update="coverlet.msbuild" Version="2.8.1" />
4748
<PackageReference Update="coverlet.collector" Version="1.2.1" />
4849

4950
<!-- Demo project -->
50-
<PackageReference Update="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
51-
<PackageReference Update="Nito.Disposables" Version="2.1.0" />
51+
<PackageReference Update="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.37" />
52+
<PackageReference Update="Nito.Disposables" Version="2.2.1" />
5253
<PackageReference Update="Nito.Mvvm.Async" Version="1.0.0-pre-03" />
53-
<PackageReference Update="Nito.Mvvm.CalculatedProperties" Version="1.0.2" />
54-
<PackageReference Update="Nito.Mvvm.Core" Version="1.2.2" />
55-
<PackageReference Update="Ookii.Dialogs.Wpf" Version="3.1.0" />
54+
<PackageReference Update="Nito.Mvvm.CalculatedProperties" Version="1.3.1" />
55+
<PackageReference Update="Nito.Mvvm.Core" Version="1.3.1" />
56+
<PackageReference Update="Ookii.Dialogs.Wpf" Version="4.0.0" />
5657

5758
</ItemGroup>
5859

src/ImageHash/ImageHash.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>Perceptual image hashing in netstandard using the ImageSharp library. Includes three hashing algorithms (AverageHash, DifferenceHash, and PerceptualHash).</Description>
55
<Authors>Coen van den Munckhof</Authors>
66
<Owners>$(Authors)</Owners>
7-
<TargetFrameworks>netstandard1.3;netstandard2.0;netcoreapp2.1</TargetFrameworks>
7+
<TargetFrameworks>netstandard1.3;netstandard2.0;netcoreapp2.1;netcoreapp3.1;net5</TargetFrameworks>
88
<TargetFrameworks Condition="'$(OS)' != 'Unix'">$(TargetFrameworks);net461;net472</TargetFrameworks>
99
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1010
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -23,12 +23,8 @@
2323
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2424
<NeutralLanguage>en</NeutralLanguage>
2525
<PackageDescription>$(Description)</PackageDescription>
26-
<!--
27-
<PackageReleaseNotes>
28-
1.0.0-beta0005
29-
* Updated to ImageSharp 1.0.1
30-
</PackageReleaseNotes>
31-
-->
26+
<PackageReleaseNotes></PackageReleaseNotes>
27+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
3228
</PropertyGroup>
3329

3430
<!-- Used by SourceLink -->
@@ -37,10 +33,14 @@
3733
</PropertyGroup>
3834

3935
<ItemGroup>
40-
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
36+
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" Condition="$(Configuration) == 'Release'" />
4137
<PackageReference Include="SixLabors.ImageSharp" />
4238
</ItemGroup>
4339

40+
<PropertyGroup Condition="$(Configuration) == 'Release'">
41+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
42+
</PropertyGroup>
43+
4444
<ItemGroup>
4545
<None Include="$(MSBuildThisFileDirectory)..\..\icon\ImageHash.128.png" Pack="true" PackagePath="$(PackageIcon)" Visible="false" />
4646
</ItemGroup>

tests/ImageHash.Test/Examples.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
using CoenM.ImageHash.HashAlgorithms;
66

77
// These examples are used to generate snippets for markdown documentation.
8+
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1123:Do not place regions within elements", Justification = "Source is used for generating markdown docs.")]
9+
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1515:Single-line comment should be preceded by blank line", Justification = "Source is used for generating markdown docs.")]
10+
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1512:Single-line comments should not be followed by blank line", Justification = "Source is used for generating markdown docs.")]
811
public class Examples
912
{
1013
public void CalculateImageHashDemo()

0 commit comments

Comments
 (0)