Browse Source

fix some tests and updated packages

af/merge-core
Scott Williams 9 years ago
parent
commit
696c48d02e
  1. 4
      ImageSharp.ruleset
  2. 15
      ImageSharp.sln
  3. 22
      README.md
  4. 30
      appveyor.yml
  5. 5
      global.json
  6. 1
      src/ImageSharp.Drawing/ImageSharp.Drawing.csproj
  7. 2
      src/ImageSharp/ImageSharp.csproj
  8. 2
      tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj
  9. 7
      tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj
  10. 10
      tests/ImageSharp.Sandbox46/Program.cs
  11. 2
      tests/ImageSharp.Tests/Colorspaces/CieLabAndCieLchConversionTests.cs
  12. 2
      tests/ImageSharp.Tests/Colorspaces/CieLuvAndCieLchuvConversionTests.cs
  13. 3
      tests/ImageSharp.Tests/GlobalSuppressions.cs
  14. 3
      tests/ImageSharp.Tests/IO/EndianBinaryReaderTests.cs
  15. 4
      tests/ImageSharp.Tests/ImageSharp.Tests.csproj
  16. 2
      tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs
  17. 11
      tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs

4
ImageSharp.ruleset

@ -5,7 +5,7 @@
<Rule Id="SA1413" Action="None" />
<!-- <Rule Id="SA1405" Action="None" />
temp remove the header requirement as stylecop is currently failing to read the stylecop.json file from 'dotnet build'
<Rule Id="SA1636" Action="None" />
<Rule Id="SA1633" Action="None" />-->
<Rule Id="SA1636" Action="None" />-->
<Rule Id="SA1633" Action="None" />
</Rules>
</RuleSet>

15
ImageSharp.sln

@ -46,6 +46,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvatarWithRoundedCorner", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChangeDefaultEncoderOptions", "samples\ChangeDefaultEncoderOptions\ChangeDefaultEncoderOptions.csproj", "{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Sandbox46", "tests\ImageSharp.Sandbox46\ImageSharp.Sandbox46.csproj", "{561B880A-D9EE-44EF-90F5-817C54A9D9AB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -128,6 +130,18 @@ Global
{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}.Release|x64.Build.0 = Release|Any CPU
{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}.Release|x86.ActiveCfg = Release|Any CPU
{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}.Release|x86.Build.0 = Release|Any CPU
{561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|x64.ActiveCfg = Debug|Any CPU
{561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|x64.Build.0 = Debug|Any CPU
{561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|x86.ActiveCfg = Debug|Any CPU
{561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|x86.Build.0 = Debug|Any CPU
{561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|Any CPU.Build.0 = Release|Any CPU
{561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|x64.ActiveCfg = Release|Any CPU
{561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|x64.Build.0 = Release|Any CPU
{561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|x86.ActiveCfg = Release|Any CPU
{561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -140,6 +154,7 @@ Global
{2BF743D8-2A06-412D-96D7-F448F00C5EA5} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
{844FC582-4E78-4371-847D-EFD4D1103578} = {7CC6D57E-B916-43B8-B315-A0BB92F260A2}
{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0} = {7CC6D57E-B916-43B8-B315-A0BB92F260A2}
{561B880A-D9EE-44EF-90F5-817C54A9D9AB} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5F8B9D1F-CD8B-4CC5-8216-D531E25BD795}

22
README.md

@ -7,7 +7,7 @@ Built against .Net Standard 1.1 ImageSharp can be used in device, cloud, and emb
> **ImageSharp** has made excellent progress and contains many great features but is still considered by us to be still in early stages (alpha). As such, we cannot support its use on production environments until the library reaches release candidate status.
>
> Pre-release downloads are available from the [MyGet package repository](https://www.myget.org/gallery/imagesharp).
> Pre-release downloads are available from the [MyGet package repository](https://www.myget.org/gallery/sixlabors).
[![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/SixLabors/ImageSharp/master/APACHE-2.0-LICENSE.txt)
[![GitHub issues](https://img.shields.io/github/issues/SixLabors/ImageSharp.svg)](https://github.com/SixLabors/ImageSharp/issues)
@ -31,20 +31,20 @@ At present the code is pre-release but when ready it will be available on [Nuget
**Pre-release downloads**
We already have a [MyGet package repository](https://www.myget.org/gallery/imagesharp) - for bleeding-edge / development NuGet releases.
We already have a [MyGet package repository](https://www.myget.org/gallery/sixlabors) - for bleeding-edge / development NuGet releases.
### Packages
The **ImageSharp** library is made up of multiple packages.
Packages include:
- **ImageSharp**
- **SixLabors.ImageSharp**
- Contains the generic `Image<TPixel>` class, PixelFormats, Primitives, Configuration, and other core functionality.
- The `IImageFormat` interface, Jpeg, Png, Bmp, and Gif formats.
- Transform methods like Resize, Crop, Skew, Rotate - Anything that alters the dimensions of the image.
- Non-transform methods like Gaussian Blur, Pixelate, Edge Detection - Anything that maintains the original image dimensions.
- **ImageSharp.Drawing**
- **SixLabors.ImageSharp.Drawing**
- Brushes and various drawing algorithms, including drawing images.
- Various vector drawing methods for drawing paths, polygons etc.
- Text drawing.
@ -88,9 +88,10 @@ On platforms supporting netstandard 1.3+
// Image.Load(string path) is a shortcut for our default type. Other pixel formats use Image.Load<TPixel>(string path))
using (Image<Rgba32> image = Image.Load("foo.jpg"))
{
image.Resize(image.Width / 2, image.Height / 2)
.Grayscale()
.Save("bar.jpg"); // automatic encoder selected based on extension.
image.Mutate(x=>x
.Resize(image.Width / 2, image.Height / 2)
.Grayscale());
image.Save("bar.jpg"); // automatic encoder selected based on extension.
}
```
on netstandard 1.1 - 1.2
@ -100,9 +101,10 @@ using (FileStream stream = File.OpenRead("foo.jpg"))
using (FileStream output = File.OpenWrite("bar.jpg"))
using (Image<Rgba32> image = Image.Load<Rgba32>(stream))
{
image.Resize(image.Width / 2, image.Height / 2)
.Grayscale()
.Save(output);
image.Mutate(x=>x
.Resize(image.Width / 2, image.Height / 2)
.Grayscale());
image.Save(output);
}
```

30
appveyor.yml

@ -1,11 +1,13 @@
version: 1.0.0.{build}
image: Visual Studio 2017
# prevent the double build when a branch has an active PR
skip_branch_with_pr: true
init:
- ps: iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/PureKrome/0f79e25693d574807939/raw/8cf3160c9516ef1f4effc825c0a44acc918a0b5a/appveyor-build-info.ps'))
install:
- choco install gitversion.portable -pre -y
before_build:
- cmd: dotnet --version
- ps: gitversion /l console /output buildserver
build_script:
- cmd: build.cmd
@ -13,16 +15,16 @@ build_script:
test_script:
- tests\CodeCoverage\CodeCoverage.cmd
artifacts:
- path: artifacts\bin\ImageSharp\**\*.nupkg
after_build:
- cmd: appveyor PushArtifact "artifacts\SixLabors.ImageSharp.%GitVersion_NuGetVersion%.nupkg"
deploy:
# MyGet Deployment for builds & releases
- provider: NuGet
server: https://www.myget.org/F/imagesharp/api/v2/package
symbol_server: https://www.myget.org/F/imagesharp/symbols/api/v2/package
api_key:
secure: P2Fz82nty+itjL+kNRCsMQcqzngmVtkU0R4CZqgST7zgUaE6/1q9ekh5MKKlZLkD
artifact: /.*\.nupkg/
on:
branch: master
- provider: NuGet
server: https://www.myget.org/F/sixlabors/api/v2/package
symbol_server: https://www.myget.org/F/sixlabors/symbols/api/v2/package
api_key:
secure: V/lEHP0UeMWIpWd0fiNlY2IgbCnJKQlGdRksECdJbOBdaE20Fl0RNL7WyqHe02o4
artifact: /.*\.nupkg/
on:
branch: master

5
global.json

@ -1,5 +0,0 @@
{
"sdk": {
"version": "1.1.0"
}
}

1
src/ImageSharp.Drawing/ImageSharp.Drawing.csproj

@ -37,6 +37,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="SixLabors.Shapes.Text" Version="0.1.0-alpha0019" />
<PackageReference Include="SixLabors.Shapes" Version="0.1.0-alpha0019" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004">
<PrivateAssets>All</PrivateAssets>
</PackageReference>

2
src/ImageSharp/ImageSharp.csproj

@ -39,7 +39,7 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Buffers" Version="4.4.0" />
<PackageReference Include="System.Memory" Version="4.4.0-preview1-25305-02" />
<PackageReference Include="System.Memory" Version="4.4.0-preview2-25405-01" />
<PackageReference Include="System.Threading.Tasks.Parallel" Version="4.3.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.4.0" />
<PackageReference Include="System.Numerics.Vectors" Version="4.4.0" />

2
tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>netcoreapp1.1;net461</TargetFrameworks>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<RootNamespace>SixLabors.ImageSharp.Benchmarks</RootNamespace>

7
tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj

@ -5,11 +5,12 @@
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
<AssemblyName>ImageSharp.Sandbox46</AssemblyName>
<AssemblyName>SixLabors.ImageSharp.Sandbox46</AssemblyName>
<Description>A cross-platform library for processing of image files written in C#</Description>
<Copyright>Copyright © James Jackson-South and contributors.</Copyright>
<Authors>James Jackson-South and contributors</Authors>
<Company>James Jackson-South</Company>
<RootNamespace>SixLabors.ImageSharp.Sandbox46</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\ImageSharp.Drawing\ImageSharp.Drawing.csproj" />
@ -17,8 +18,8 @@
</ItemGroup>
<ItemGroup>
<!--<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />-->
<PackageReference Include="Moq" Version="4.7.1" />
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" />
<PackageReference Include="Moq" Version="4.7.99" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3742" />
<!--<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />-->
</ItemGroup>
<ItemGroup>

10
tests/ImageSharp.Sandbox46/Program.cs

@ -8,11 +8,11 @@ namespace ImageSharp.Sandbox46
using System;
using System.Runtime.DesignerServices;
using ImageSharp.Tests;
using ImageSharp.Tests.Colors;
using ImageSharp.Tests.PixelFormats;
using ImageSharp.Tests.Processing.Processors.Transforms;
using ImageSharp.Tests.Processing.Transforms;
using SixLabors.ImageSharp.Tests;
using SixLabors.ImageSharp.Tests.Colors;
using SixLabors.ImageSharp.Tests.PixelFormats;
using SixLabors.ImageSharp.Tests.Processing.Processors.Transforms;
using SixLabors.ImageSharp.Tests.Processing.Transforms;
using Xunit.Abstractions;

2
tests/ImageSharp.Tests/Colorspaces/CieLabAndCieLchConversionTests.cs

@ -30,7 +30,6 @@ namespace SixLabors.ImageSharp.Tests.Colorspaces
[InlineData(100, 0, 0, 100, 0, 0)]
[InlineData(100, 50, 180, 100, -50, 0)]
[InlineData(10, 36.0555, 56.3099, 10, 20, 30)]
[InlineData(10, 36.0555, 56.3099, 10, 20, 30)]
[InlineData(10, 36.0555, 123.6901, 10, -20, 30)]
[InlineData(10, 36.0555, 303.6901, 10, 20, -30)]
[InlineData(10, 36.0555, 236.3099, 10, -20, -30)]
@ -57,7 +56,6 @@ namespace SixLabors.ImageSharp.Tests.Colorspaces
[InlineData(100, 0, 0, 100, 0, 0)]
[InlineData(100, -50, 0, 100, 50, 180)]
[InlineData(10, 20, 30, 10, 36.0555, 56.3099)]
[InlineData(10, 20, 30, 10, 36.0555, 56.3099)]
[InlineData(10, -20, 30, 10, 36.0555, 123.6901)]
[InlineData(10, 20, -30, 10, 36.0555, 303.6901)]
[InlineData(10, -20, -30, 10, 36.0555, 236.3099)]

2
tests/ImageSharp.Tests/Colorspaces/CieLuvAndCieLchuvConversionTests.cs

@ -30,7 +30,6 @@ namespace SixLabors.ImageSharp.Tests.Colorspaces
[InlineData(100, 0, 0, 100, 0, 0)]
[InlineData(100, 50, 180, 100, -50, 0)]
[InlineData(10, 36.0555, 56.3099, 10, 20, 30)]
[InlineData(10, 36.0555, 56.3099, 10, 20, 30)]
[InlineData(10, 36.0555, 123.6901, 10, -20, 30)]
[InlineData(10, 36.0555, 303.6901, 10, 20, -30)]
[InlineData(10, 36.0555, 236.3099, 10, -20, -30)]
@ -57,7 +56,6 @@ namespace SixLabors.ImageSharp.Tests.Colorspaces
[InlineData(100, 0, 0, 100, 0, 0)]
[InlineData(100, -50, 0, 100, 50, 180)]
[InlineData(10, 20, 30, 10, 36.0555, 56.3099)]
[InlineData(10, 20, 30, 10, 36.0555, 56.3099)]
[InlineData(10, -20, 30, 10, 36.0555, 123.6901)]
[InlineData(10, 20, -30, 10, 36.0555, 303.6901)]
[InlineData(10, -20, -30, 10, 36.0555, 236.3099)]

3
tests/ImageSharp.Tests/GlobalSuppressions.cs

@ -4,5 +4,6 @@
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1004:Test methods should not be skipped", Justification = "<Pending>", Scope = "member", Target = "~M:ImageSharp.Tests.Processing.Transforms.PadTest.Pad_width_height_ResizeProcessorWithCorrectOPtionsSet")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Assertions", "xUnit2013:Do not use equality check to check for collection size.")]

3
tests/ImageSharp.Tests/IO/EndianBinaryReaderTests.cs

@ -45,8 +45,7 @@ namespace SixLabors.ImageSharp.Tests.IO
[Fact]
public void ReadCharsBeyondProvidedBufferSize()
{
Assert.Throws(
typeof(ArgumentException),
Assert.Throws<ArgumentException>(
() =>
{
MemoryStream stream = new MemoryStream(TestBytes);

4
tests/ImageSharp.Tests/ImageSharp.Tests.csproj

@ -18,8 +18,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Moq" Version="4.7.99" />
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3742" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta4-build3742" />
<!--<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta001">
<PrivateAssets>All</PrivateAssets>
</PackageReference>-->

2
tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs

@ -46,7 +46,7 @@ namespace SixLabors.ImageSharp.Tests
[Theory]
[WithBlankImages(1, 1, PixelTypes.Rgba32, PixelTypes.Rgba32)]
[WithBlankImages(1, 1, PixelTypes.Alpha8, PixelTypes.Alpha8)]
[WithBlankImages(1, 1, PixelTypes.Rgba32, PixelTypes.Rgba32)]
[WithBlankImages(1, 1, PixelTypes.Rgba32, PixelTypes.Argb32)]
public void PixelType_PropertyValueIsCorrect<TPixel>(TestImageProvider<TPixel> provider, PixelTypes expected)
where TPixel : struct, IPixel<TPixel>
{

11
tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs

@ -46,16 +46,6 @@ namespace SixLabors.ImageSharp.Tests
return image;
}
[Fact]
public void Baz()
{
Type type = typeof(Rgba32).GetTypeInfo().Assembly.GetType("ImageSharp.Rgba32");
this.Output.WriteLine(type.ToString());
Type fake = typeof(Rgba32).GetTypeInfo().Assembly.GetType("ImageSharp.dsaada_DASqewrr");
Assert.Null(fake);
}
[Theory]
[WithFile(TestImages.Bmp.Car, PixelTypes.Rgba32, true)]
[WithFile(TestImages.Bmp.Car, PixelTypes.Rgba32, false)]
@ -84,7 +74,6 @@ namespace SixLabors.ImageSharp.Tests
[InlineData(PixelTypes.Rgba32, typeof(Rgba32))]
[InlineData(PixelTypes.Argb32, typeof(Argb32))]
[InlineData(PixelTypes.HalfVector4, typeof(HalfVector4))]
[InlineData(PixelTypes.Rgba32, typeof(Rgba32))]
public void ToType(PixelTypes pt, Type expectedType)
{
Assert.Equal(pt.ToType(), expectedType);

Loading…
Cancel
Save