Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ 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
4.8.1
6.0.x
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 }}
39 changes: 19 additions & 20 deletions LibSquishNet.Tests/LibSquishNet.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<TargetFrameworks>net462;net481;net6.0-windows;net8.0-windows</TargetFrameworks>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>win</RuntimeIdentifier>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<Platform>AnyCPU</Platform>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.3.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" PrivateAssets="all" />
<PackageReference Include="coverlet.collector" Version="6.0.2" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-windows'">
<PackageReference Include="NuGet.Build.Tasks.Pack" Version="6.11.0" PrivateAssets="all" />
<PackageReference Include="System.Drawing.Common" Version="8.0.8" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows'">
<PackageReference Include="NuGet.Build.Tasks.Pack" Version="6.11.0" PrivateAssets="all" />
<PackageReference Include="System.Drawing.Common" Version="8.0.8" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\LibSquishNet\LibSquishNet.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="Files\errol.256x256.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Files\errol.256x256.png" CopyToOutputDirectory="Always" />
</ItemGroup>

</Project>
</Project>
6 changes: 3 additions & 3 deletions LibSquishNet.sln
Original file line number Diff line number Diff line change
@@ -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
Expand Down
120 changes: 30 additions & 90 deletions LibSquishNet/LibSquishNet.csproj
Original file line number Diff line number Diff line change
@@ -1,103 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net462;net481;net6.0;net8.0</TargetFrameworks>
<SelfContained>false</SelfContained>
<Platform>Any CPU</Platform>
<Authors>MaxxWyndham</Authors>
<AssemblyTitle>LibSquishNet</AssemblyTitle>
<Product>LibSquishNet</Product>
<Title>LibSquishNet</Title>
<Description>libsquish in .net!</Description>
<VersionPrefix>2.1.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Description>A .net port of Simon Brown's libsquish</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageProjectUrl>https://github.com/MaxxWyndham/LibSquishNet</PackageProjectUrl>
<PackageReleaseNotes>
v2.0.0
- Now with parallelism!
</PackageReleaseNotes>
<PackageReleaseNotes>v2.1.0 - Parallelism and broader framework support</PackageReleaseNotes>
<IncludeContentInPack>true</IncludeContentInPack>
<Company>C# by Maxx Wyndham, original by Simon Brown</Company>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
<FileVersion>2.1.0.0</FileVersion>
</PropertyGroup>

<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);ReadPackageVersionFromOutputAssembly</GenerateNuspecDependsOn>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);PackageInfo</GenerateNuspecDependsOn>
</PropertyGroup>
<Target Name="ReadPackageVersionFromOutputAssembly" DependsOnTargets="Build">
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
<Output TaskParameter="Assemblies" ItemName="PackAssembly" />
</GetAssemblyIdentity>
<PropertyGroup>
<PackageVersion>%(PackAssembly.Version)</PackageVersion>
</PropertyGroup>

<Target Name="PackageInfo" DependsOnTargets="Build">
<GetPackOutputItemsTask PackageVersion="$(AssemblyVersion)" PackageId="$(AssemblyTitle)" PackageOutputPath="$(BaseOutputPath)\Release" NuspecOutputPath="$(BaseOutputPath)\Release" SymbolPackageFormat="snupkg" />
</Target>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8B187D46-BC8E-4B5A-AE68-326958BC9AAA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LibSquishNet</RootNamespace>
<AssemblyName>LibSquishNet</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="NuGet.Build.Tasks.Pack" Version="6.11.0" PrivateAssets="all" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<Compile Include="ClusterFit.cs" />
<Compile Include="ColourBlock.cs" />
<Compile Include="ColourFit.cs" />
<Compile Include="ColourSet.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="SingleColourLookup.cs" />
<Compile Include="SourceBlock.cs" />
<Compile Include="Sym3x3.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RangeFit.cs" />
<Compile Include="SingleColourFit.cs" />
<Compile Include="SingleColourLookupIns.cs" />
<Compile Include="Squish.cs" />
<None Include="LICENSE" Pack="true" PackagePath="" Visible="true" />
<None Include="..\README.md" Pack="true" PackagePath="" Visible="true" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NuGet.Build.Tasks.Pack">
<Version>5.10.0-preview.2.7185</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="LICENSE" Pack="true" PackagePath="" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
36 changes: 0 additions & 36 deletions LibSquishNet/Properties/AssemblyInfo.cs

This file was deleted.

5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down