From bc0bd4c29881b1c78e026acd466d16c1fe264f65 Mon Sep 17 00:00:00 2001 From: Silent Spud <1478389+SilentSpud@users.noreply.github.com> Date: Thu, 15 Aug 2024 16:56:58 -0600 Subject: [PATCH 1/5] update to net 8 --- LibSquishNet.Tests/LibSquishNet.Tests.csproj | 22 +++--- LibSquishNet.sln | 6 +- LibSquishNet/LibSquishNet.csproj | 82 ++++---------------- LibSquishNet/Properties/AssemblyInfo.cs | 23 ------ 4 files changed, 27 insertions(+), 106 deletions(-) diff --git a/LibSquishNet.Tests/LibSquishNet.Tests.csproj b/LibSquishNet.Tests/LibSquishNet.Tests.csproj index e605a92..a3b7dc1 100644 --- a/LibSquishNet.Tests/LibSquishNet.Tests.csproj +++ b/LibSquishNet.Tests/LibSquishNet.Tests.csproj @@ -1,30 +1,30 @@  - - net46 + net8.0 - - - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - - Always - - + \ No newline at end of file diff --git a/LibSquishNet.sln b/LibSquishNet.sln index facbab8..be3a296 100644 --- a/LibSquishNet.sln +++ b/LibSquishNet.sln @@ -1,11 +1,11 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.31229.75 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibSquishNet", "LibSquishNet\LibSquishNet.csproj", "{8B187D46-BC8E-4B5A-AE68-326958BC9AAA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibSquishNet", "LibSquishNet\LibSquishNet.csproj", "{8B187D46-BC8E-4B5A-AE68-326958BC9AAA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibSquishNet.Tests", "LibSquishNet.Tests\LibSquishNet.Tests.csproj", "{3C99A2A5-D011-402A-81D6-A11FFF790721}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibSquishNet.Tests", "LibSquishNet.Tests\LibSquishNet.Tests.csproj", "{3C99A2A5-D011-402A-81D6-A11FFF790721}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/LibSquishNet/LibSquishNet.csproj b/LibSquishNet/LibSquishNet.csproj index b3e9713..77c5fbc 100644 --- a/LibSquishNet/LibSquishNet.csproj +++ b/LibSquishNet/LibSquishNet.csproj @@ -1,15 +1,16 @@ - - + + net8.0 MaxxWyndham LibSquishNet - libsquish in .net! + A .net port of Simon Brown%27s libsquish LICENSE https://github.com/MaxxWyndham/LibSquishNet v2.0.0 - Now with parallelism! + false false @@ -23,81 +24,24 @@ %(PackAssembly.Version) - - Debug - AnyCPU - {8B187D46-BC8E-4B5A-AE68-326958BC9AAA} Library - Properties - LibSquishNet - LibSquishNet - v4.6 - 512 - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false + LibSquishNet + C# by Maxx Wyndham, original by Simon Brown + LibSquishNet + 2.0.0.0 + 2.0.0.0 - - - - - - - - - - - - - - - - - - - - - - - - - + - 5.10.0-preview.2.7185 + 6.11.0 runtime; build; native; contentfiles; analyzers; buildtransitive all + - + - - \ No newline at end of file diff --git a/LibSquishNet/Properties/AssemblyInfo.cs b/LibSquishNet/Properties/AssemblyInfo.cs index 8b63b9b..a0cd9c2 100644 --- a/LibSquishNet/Properties/AssemblyInfo.cs +++ b/LibSquishNet/Properties/AssemblyInfo.cs @@ -1,16 +1,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("LibSquishNet")] -[assembly: AssemblyDescription("A .net port of Simon Brown's libsquish")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("C# by Maxx Wyndham, original by Simon Brown")] -[assembly: AssemblyProduct("LibSquishNet")] -[assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -21,16 +11,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("89ede28a-3261-4b7f-a8e9-619cc7bd31ee")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.0.0")] -[assembly: AssemblyFileVersion("2.0.0.0")] From 40ac281daa4c489c6bd0f828e70e9bf4506e4ac0 Mon Sep 17 00:00:00 2001 From: Silent Spud <1478389+SilentSpud@users.noreply.github.com> Date: Thu, 15 Aug 2024 18:20:24 -0600 Subject: [PATCH 2/5] add net462 target --- LibSquishNet.Tests/LibSquishNet.Tests.csproj | 14 +++++++------ LibSquishNet/LibSquishNet.csproj | 2 +- LibSquishNet/Properties/AssemblyInfo.cs | 22 ++++++++++++++++++++ 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/LibSquishNet.Tests/LibSquishNet.Tests.csproj b/LibSquishNet.Tests/LibSquishNet.Tests.csproj index a3b7dc1..1969cc5 100644 --- a/LibSquishNet.Tests/LibSquishNet.Tests.csproj +++ b/LibSquishNet.Tests/LibSquishNet.Tests.csproj @@ -1,14 +1,9 @@  - net8.0 + net462;net8.0 - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - runtime; build; native; contentfiles; analyzers; buildtransitive @@ -19,6 +14,13 @@ all + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/LibSquishNet/LibSquishNet.csproj b/LibSquishNet/LibSquishNet.csproj index 77c5fbc..896d0dc 100644 --- a/LibSquishNet/LibSquishNet.csproj +++ b/LibSquishNet/LibSquishNet.csproj @@ -1,6 +1,6 @@  - net8.0 + net462;net8.0 MaxxWyndham LibSquishNet A .net port of Simon Brown%27s libsquish diff --git a/LibSquishNet/Properties/AssemblyInfo.cs b/LibSquishNet/Properties/AssemblyInfo.cs index a0cd9c2..b744d9b 100644 --- a/LibSquishNet/Properties/AssemblyInfo.cs +++ b/LibSquishNet/Properties/AssemblyInfo.cs @@ -4,6 +4,28 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] +#if NETFRAMEWORK +[assembly: AssemblyTitle("LibSquishNet")] +[assembly: AssemblyDescription("A .net port of Simon Brown's libsquish")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("C# by Maxx Wyndham, original by Simon Brown")] +[assembly: AssemblyProduct("LibSquishNet")] +[assembly: AssemblyCopyright("")] +#endif + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] + // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. From 28d964f7a850497cd2bdc277fbd0ab94cdbe1f4a Mon Sep 17 00:00:00 2001 From: Silent Spud <1478389+SilentSpud@users.noreply.github.com> Date: Sat, 17 Aug 2024 22:28:29 -0600 Subject: [PATCH 3/5] Update csproj and workflow to build all frameworks --- .github/workflows/main.yml | 38 ++++++------- LibSquishNet.Tests/LibSquishNet.Tests.csproj | 26 +++------ LibSquishNet/LibSquishNet.csproj | 60 ++++++++++---------- LibSquishNet/Properties/AssemblyInfo.cs | 35 ------------ 4 files changed, 56 insertions(+), 103 deletions(-) delete mode 100644 LibSquishNet/Properties/AssemblyInfo.cs diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e38a9c8..808e4b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,26 +11,24 @@ jobs: runs-on: windows-latest steps: - - name: Checkout Code - uses: actions/checkout@v1 + - name: Checkout Code + uses: actions/checkout@v4 - - name: Setup MSBuild Path - uses: microsoft/setup-msbuild@v1.0.2 - - - name: Setup NuGet - uses: NuGet/setup-nuget@v1.0.5 - - - name: Restore NuGet Packages - run: msbuild -t:restore - - - name: Build - run: msbuild -t:build -p:Configuration=Release - - - name: Pack - run: msbuild -t:pack -p:Configuration=Release + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 4.6.2 + 8.0.x + + - name: Restore NuGet Packages + run: dotnet restore /p:Platform="Any CPU" + + - name: Build + run: dotnet build --configuration Release /p:Platform="Any CPU" - - name: Configure nuget - run: nuget setapikey ${{secrets.NUGET_API_KEY}} + - name: Pack + run: dotnet pack --configuration Release /p:Platform="Any CPU" - - name: Publish - run: nuget push LibSquishNet\bin\Release\*.nupkg -SkipDuplicate -source https://api.nuget.org/v3/index.json + - name: Publish + run: dotnet nuget push LibSquishNet\bin\Release\*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --key ${{ secrets.NUGET_API_KEY }} \ No newline at end of file diff --git a/LibSquishNet.Tests/LibSquishNet.Tests.csproj b/LibSquishNet.Tests/LibSquishNet.Tests.csproj index 1969cc5..0b23841 100644 --- a/LibSquishNet.Tests/LibSquishNet.Tests.csproj +++ b/LibSquishNet.Tests/LibSquishNet.Tests.csproj @@ -1,32 +1,24 @@  - net462;net8.0 + net462;net8.0-windows + win + true + AnyCPU - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + + - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + - - Always - + \ No newline at end of file diff --git a/LibSquishNet/LibSquishNet.csproj b/LibSquishNet/LibSquishNet.csproj index 896d0dc..0563b15 100644 --- a/LibSquishNet/LibSquishNet.csproj +++ b/LibSquishNet/LibSquishNet.csproj @@ -1,47 +1,45 @@  + Library net462;net8.0 + Any CPU MaxxWyndham + LibSquishNet + LibSquishNet LibSquishNet - A .net port of Simon Brown%27s libsquish - LICENSE + 2.1.0 + + A .net port of Simon Brown's libsquish + license https://github.com/MaxxWyndham/LibSquishNet - - v2.0.0 - - Now with parallelism! - - false + v2.1.0 - Now with parallelism! + true + C# by Maxx Wyndham, original by Simon Brown + 2.1.0.0 + 2.1.0.0 + - false - $(GenerateNuspecDependsOn);ReadPackageVersionFromOutputAssembly + true + $(GenerateNuspecDependsOn);PackageInfo - - - - - - %(PackAssembly.Version) - + + + - - Library - LibSquishNet - C# by Maxx Wyndham, original by Simon Brown - LibSquishNet - 2.0.0.0 - 2.0.0.0 - + - - 6.11.0 - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + + - + - \ No newline at end of file + diff --git a/LibSquishNet/Properties/AssemblyInfo.cs b/LibSquishNet/Properties/AssemblyInfo.cs deleted file mode 100644 index b744d9b..0000000 --- a/LibSquishNet/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -#if NETFRAMEWORK -[assembly: AssemblyTitle("LibSquishNet")] -[assembly: AssemblyDescription("A .net port of Simon Brown's libsquish")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("C# by Maxx Wyndham, original by Simon Brown")] -[assembly: AssemblyProduct("LibSquishNet")] -[assembly: AssemblyCopyright("")] -#endif - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.0.0")] -[assembly: AssemblyFileVersion("2.0.0.0")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("89ede28a-3261-4b7f-a8e9-619cc7bd31ee")] From 2a7ab07274e349550704994a8abc394af7431f8f Mon Sep 17 00:00:00 2001 From: Silent Spud <1478389+SilentSpud@users.noreply.github.com> Date: Sun, 18 Aug 2024 00:19:24 -0600 Subject: [PATCH 4/5] add .net 4.8.1 and .net 6 --- .github/workflows/main.yml | 2 ++ LibSquishNet.Tests/LibSquishNet.Tests.csproj | 7 ++++++- LibSquishNet/LibSquishNet.csproj | 10 +++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 808e4b7..5beae95 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,8 @@ jobs: with: dotnet-version: | 4.6.2 + 4.8.1 + 6.0.x 8.0.x - name: Restore NuGet Packages diff --git a/LibSquishNet.Tests/LibSquishNet.Tests.csproj b/LibSquishNet.Tests/LibSquishNet.Tests.csproj index 0b23841..c14a10a 100644 --- a/LibSquishNet.Tests/LibSquishNet.Tests.csproj +++ b/LibSquishNet.Tests/LibSquishNet.Tests.csproj @@ -1,6 +1,7 @@  - net462;net8.0-windows + net462;net481;net6.0-windows;net8.0-windows + false win true AnyCPU @@ -15,6 +16,10 @@ + + + + diff --git a/LibSquishNet/LibSquishNet.csproj b/LibSquishNet/LibSquishNet.csproj index 0563b15..9b73bfe 100644 --- a/LibSquishNet/LibSquishNet.csproj +++ b/LibSquishNet/LibSquishNet.csproj @@ -1,7 +1,8 @@  Library - net462;net8.0 + net462;net481;net6.0;net8.0 + false Any CPU MaxxWyndham LibSquishNet @@ -25,12 +26,7 @@ - + From d21355132d0da7eec4ba6dc1195e9961246f9c8a Mon Sep 17 00:00:00 2001 From: Silent Spud <1478389+SilentSpud@users.noreply.github.com> Date: Sun, 18 Aug 2024 00:29:42 -0600 Subject: [PATCH 5/5] Update changelog --- LibSquishNet/LibSquishNet.csproj | 8 +++++--- README.md | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/LibSquishNet/LibSquishNet.csproj b/LibSquishNet/LibSquishNet.csproj index 9b73bfe..965f33b 100644 --- a/LibSquishNet/LibSquishNet.csproj +++ b/LibSquishNet/LibSquishNet.csproj @@ -11,9 +11,10 @@ 2.1.0 A .net port of Simon Brown's libsquish - license + README.md + LICENSE https://github.com/MaxxWyndham/LibSquishNet - v2.1.0 - Now with parallelism! + v2.1.0 - Parallelism and broader framework support true C# by Maxx Wyndham, original by Simon Brown 2.1.0.0 @@ -36,6 +37,7 @@ - + + diff --git a/README.md b/README.md index e623a73..863ad55 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,15 @@ ![Nuget](https://img.shields.io/nuget/v/LibSquishNet) -A partial port of Simon Brown's v1.11 libsquish to .NET Framework 4.6 +A partial port of Simon Brown's v1.11 libsquish to .NET Original project is available here https://code.google.com/p/libsquish/ **Changelog** +**v2.1.0** +Updated to .NET 4.6.2, and added support for .NET 4.8.1, 6.0, and 8.0. + **v2.0.0** Parallism! A basic implementation using Parallel.For on the primary loop. Reduces compression time considerably. Pass true into `CompressImage` for the new `parallel` parameter. Default is false. Code-style. The code is more modern C# style now.