Skip to content

Commit

Permalink
Merge pull request #44 from 786744873/main
Browse files Browse the repository at this point in the history
feat:image工具单独移出
  • Loading branch information
786744873 authored Oct 10, 2023
2 parents f4b1709 + 2b003b1 commit c22bc9e
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 15 deletions.
11 changes: 5 additions & 6 deletions EasyTool.Core/EasyTool.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
A open source C# tool to make .NET easy
</Description>
<PackageTags>Tool Power</PackageTags>
<RepositoryUrl>https://github.com/786744873/easytool</RepositoryUrl>
<RepositoryUrl>https://github.com/dotnet-easy/easytool</RepositoryUrl>
<PackageProjectUrl>https://easy-dotnet.com</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
Expand All @@ -35,11 +35,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.ComponentModel.Composition" Version="7.0.0" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="7.0.0" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
<PackageReference Include="System.Drawing.Primitives" Version="4.3.0" />
<PackageReference Include="System.Net.Http.Json" Version="7.0.1" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.ComponentModel.Composition" Version="8.0.0-rc.1.23419.4" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="8.0.0-rc.1.23419.4" />
<PackageReference Include="System.Net.Http.Json" Version="8.0.0-rc.1.23419.4" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion EasyTool.EmitMapper/EasyTool.EmitMapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
A open source C# tool to make .NET easy
</Description>
<PackageTags>Tool Power</PackageTags>
<RepositoryUrl>https://github.com/786744873/easytool</RepositoryUrl>
<RepositoryUrl>https://github.com/dotnet-easy/easytool</RepositoryUrl>
<PackageProjectUrl>https://easy-dotnet.com</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
Expand Down
49 changes: 49 additions & 0 deletions EasyTool.Image/EasyTool.Image.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;.net6.0</TargetFrameworks>
<LangVersion>11</LangVersion>
<Nullable>enable</Nullable>
<RootNamespace>$(MSBuildProjectName.Replace(" ", "_").Replace(".Core", ""))</RootNamespace>

<Authors>一个大西瓜,TimChen</Authors>
<Version>2023.0908.1</Version>
<Description>
A open source C# tool to make .NET easy
</Description>
<PackageTags>Tool Power</PackageTags>
<RepositoryUrl>https://github.com/dotnet-easy/easytool</RepositoryUrl>
<PackageProjectUrl>https://easy-dotnet.com</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageIcon>logo.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\logo.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="SkiaSharp" Version="2.88.6" />
<PackageReference Include="System.Drawing.Common" Version="8.0.0-rc.1.23419.5" />
</ItemGroup>

<ItemGroup>
<None Update="LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

</Project>
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions EasyTool.ImageTests/EasyTool.ImageTests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="coverlet.collector" Version="3.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\EasyTool.Image\EasyTool.Image.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Drawing;

using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Drawing;

namespace EasyTool.CoreTests.ImageCategory
{
Expand All @@ -14,16 +13,16 @@ public class ImageUtilTests
[TestMethod]
public void MaskImageTest()
{
Image ori = new Bitmap(@"C:\Desktop\ori.jpg");
Image mask = new Bitmap(@"C:\Desktop\mask.jpg");
Image ori = new Bitmap(Path.Combine(Environment.CurrentDirectory.Split("bin")[0], "ImageCategory","Resources","ori.jpg"));
Image mask = new Bitmap(Path.Combine(Environment.CurrentDirectory.Split("bin")[0], "ImageCategory", "Resources", "mask.jpg"));

Console.WriteLine($"ori-width:{ori.Width} | ori-height:{ori.Height}");
Console.WriteLine($"mask-width:{mask.Width} | mask-height:{mask.Height}");

Image result = ImgUtil.MaskImage(mask, ori);

Console.WriteLine($"result-width:{mask.Width} | result-height:{mask.Height}");
result.Save(@"C:\Desktop\result.jpg");
result.Save(Path.Combine(Environment.CurrentDirectory.Split("bin")[0], "ImageCategory", "Resources", "result.jpg"));
}

[TestMethod]
Expand Down
12 changes: 12 additions & 0 deletions EasyTool.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyTool.NPOI", "EasyTool.N
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyTool.NPOITests", "EasyTool.NPOITests\EasyTool.NPOITests.csproj", "{7AC7EC2E-003E-49E7-8124-09B88C8F8A49}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyTool.Image", "EasyTool.Image\EasyTool.Image.csproj", "{F7AEE692-A41F-4B64-A659-B3F92EA03429}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyTool.ImageTests", "EasyTool.ImageTests\EasyTool.ImageTests.csproj", "{09E30ABC-1F36-4D65-8416-AF7C5C75DA65}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -57,6 +61,14 @@ Global
{7AC7EC2E-003E-49E7-8124-09B88C8F8A49}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7AC7EC2E-003E-49E7-8124-09B88C8F8A49}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7AC7EC2E-003E-49E7-8124-09B88C8F8A49}.Release|Any CPU.Build.0 = Release|Any CPU
{F7AEE692-A41F-4B64-A659-B3F92EA03429}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F7AEE692-A41F-4B64-A659-B3F92EA03429}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7AEE692-A41F-4B64-A659-B3F92EA03429}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7AEE692-A41F-4B64-A659-B3F92EA03429}.Release|Any CPU.Build.0 = Release|Any CPU
{09E30ABC-1F36-4D65-8416-AF7C5C75DA65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09E30ABC-1F36-4D65-8416-AF7C5C75DA65}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09E30ABC-1F36-4D65-8416-AF7C5C75DA65}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09E30ABC-1F36-4D65-8416-AF7C5C75DA65}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
一个开源的 .NET 工具库, 使得开发变得更加有效率


[![pull_request](https://github.com/786744873/easytool/actions/workflows/pull_request.yml/badge.svg)](https://github.com/786744873/easytool/actions/workflows/pull_request.yml)
[![pull_request](https://github.com/dotnet-easy/easytool/actions/workflows/pull_request.yml/badge.svg)](https://github.com/dotnet-easy/easytool/actions/workflows/pull_request.yml)
[![](https://img.shields.io/nuget/v/EasyTool.Core.svg)](https://www.nuget.org/packages/EasyTool.Core)
<p>
<span>中文</span> | <a href="README.EN-US.md">English</a>
Expand Down Expand Up @@ -53,4 +53,4 @@ Easytool 封装了开发过程中一些常用的方法

**微信:ygdxg8657 (备注进群) QQ群:543829648 903210423(已满)**

![easy-tool](https://raw.githubusercontent.com/786744873/easy-dotnet/main/files/img/easytool.png)
![easy-tool](https://raw.githubusercontent.com/dotnet-easy/easy-dotnet/main/files/img/easytool.png)

0 comments on commit c22bc9e

Please sign in to comment.