Browse Source

further cleanup

pull/662/head
Anton Firszov 8 years ago
parent
commit
f7af71b1f9
  1. 9
      src/ImageSharp/Formats/Jpeg/README.md
  2. 8
      tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Baseline.cs
  3. 8
      tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Progressive.cs
  4. 17
      tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs

9
src/ImageSharp/Formats/Jpeg/README.md

@ -1,3 +1,8 @@
Encoder/Decoder adapted and extended from:
Encoder adapted and extended from:
https://golang.org/src/image/jpeg/
https://golang.org/src/image/jpeg/
Decoder orchestration code is based on:
https://github.com/mozilla/pdf.js
Huffmann decoder is based on:
https://github.com/rds1983/StbSharp

8
tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Baseline.cs

@ -42,13 +42,5 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
// TODO: We need a public ImageDecoderException class in ImageSharp!
Assert.ThrowsAny<Exception>(() => provider.GetImage(JpegDecoder));
}
[Theory(Skip = "Debug only, enable manually!")]
[WithFileCollection(nameof(BaselineTestJpegs), PixelTypes.Rgba32)]
public void CompareJpegDecoders_Baseline<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{
this.CompareJpegDecodersImpl(provider, DecodeBaselineJpegOutputName);
}
}
}

8
tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Progressive.cs

@ -33,13 +33,5 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
appendPixelTypeToFileName: false);
}
}
[Theory(Skip = "Debug only, enable manually!")]
[WithFileCollection(nameof(ProgressiveTestJpegs), PixelTypes.Rgba32)]
public void CompareJpegDecoders_Progressive<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{
this.CompareJpegDecodersImpl(provider, DecodeProgressiveJpegOutputName);
}
}
}

17
tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs

@ -63,7 +63,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
private static JpegDecoder JpegDecoder => new JpegDecoder();
[Fact]
public void ParseStream_BasicPropertiesAreCorrect1_PdfJs()
public void ParseStream_BasicPropertiesAreCorrect()
{
byte[] bytes = TestFile.Create(TestImages.Jpeg.Progressive.Progress).Bytes;
using (var ms = new MemoryStream(bytes))
@ -122,20 +122,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
return "0%";
}
private void CompareJpegDecodersImpl<TPixel>(TestImageProvider<TPixel> provider, string testName)
where TPixel : struct, IPixel<TPixel>
{
this.Output.WriteLine(provider.SourceFileOrDescription);
provider.Utility.TestName = testName;
using (Image<TPixel> image = provider.GetImage(JpegDecoder))
{
string d = this.GetDifferenceInPercentageString(image, provider);
this.Output.WriteLine($"Difference using decoder: {d}");
}
}
// DEBUG ONLY!
// The PDF.js output should be saved by "tests\ImageSharp.Tests\Formats\Jpg\pdfjs\jpeg-converter.htm"
// into "\tests\Images\ActualOutput\JpegDecoderTests\"

Loading…
Cancel
Save