Browse Source

Fix quantizer test (sneak in this PR)

Completely unrelated to the rest of the work I just don't want to have to go through the full PR, test process for this.
pull/525/head
James Jackson-South 9 years ago
parent
commit
7ad023c6e6
  1. 6
      tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs

6
tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs

@ -75,7 +75,7 @@ namespace SixLabors.ImageSharp.Tests
[WithFile(TestImages.Png.CalliphoraPartial, nameof(QuantizerNames), PixelTypes.Rgba32)] [WithFile(TestImages.Png.CalliphoraPartial, nameof(QuantizerNames), PixelTypes.Rgba32)]
[WithFile(TestImages.Png.Bike, nameof(QuantizerNames), PixelTypes.Rgba32)] [WithFile(TestImages.Png.Bike, nameof(QuantizerNames), PixelTypes.Rgba32)]
public void QuantizeImageShouldPreserveMaximumColorPrecision<TPixel>(TestImageProvider<TPixel> provider, string quantizerName) public void QuantizeImageShouldPreserveMaximumColorPrecision<TPixel>(TestImageProvider<TPixel> provider, string quantizerName)
where TPixel:struct,IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
provider.Configuration.MemoryManager = ArrayPoolMemoryManager.CreateWithModeratePooling(); provider.Configuration.MemoryManager = ArrayPoolMemoryManager.CreateWithModeratePooling();
@ -84,7 +84,7 @@ namespace SixLabors.ImageSharp.Tests
using (Image<TPixel> image = provider.GetImage()) using (Image<TPixel> image = provider.GetImage())
{ {
image.Mutate(c => c.Quantize(quantizer)); image.Mutate(c => c.Quantize(quantizer));
image.DebugSave(provider); image.DebugSave(provider, new PngEncoder() { PngColorType = PngColorType.Palette }, testOutputDetails: quantizerName);
} }
provider.Configuration.MemoryManager.ReleaseRetainedResources(); provider.Configuration.MemoryManager.ReleaseRetainedResources();
@ -128,7 +128,7 @@ namespace SixLabors.ImageSharp.Tests
private static IQuantizer GetQuantizer(string name) private static IQuantizer GetQuantizer(string name)
{ {
PropertyInfo property = typeof(KnownQuantizers).GetTypeInfo().GetProperty(name); PropertyInfo property = typeof(KnownQuantizers).GetTypeInfo().GetProperty(name);
return (IQuantizer) property.GetMethod.Invoke(null, new object[0]); return (IQuantizer)property.GetMethod.Invoke(null, new object[0]);
} }
[Fact] [Fact]

Loading…
Cancel
Save