mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.4 KiB
40 lines
1.4 KiB
// Copyright (c) Six Labors and contributors.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
|
using Microsoft.DotNet.RemoteExecutor;
|
|
using SixLabors.ImageSharp.PixelFormats;
|
|
using SixLabors.ImageSharp.Tests.TestUtilities;
|
|
using Xunit;
|
|
// ReSharper disable InconsistentNaming
|
|
|
|
namespace SixLabors.ImageSharp.Tests.Formats.Jpg
|
|
{
|
|
public partial class JpegDecoderTests
|
|
{
|
|
public const string DecodeProgressiveJpegOutputName = "DecodeProgressiveJpeg";
|
|
|
|
[Theory]
|
|
[WithFileCollection(nameof(ProgressiveTestJpegs), PixelTypes.Rgba32)]
|
|
public void DecodeProgressiveJpeg<TPixel>(TestImageProvider<TPixel> provider)
|
|
where TPixel : struct, IPixel<TPixel>
|
|
{
|
|
static void RunTest(string providerDump)
|
|
{
|
|
TestImageProvider<TPixel> provider =
|
|
BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump);
|
|
|
|
using Image<TPixel> image = provider.GetImage(JpegDecoder);
|
|
image.DebugSave(provider);
|
|
|
|
provider.Utility.TestName = DecodeProgressiveJpegOutputName;
|
|
image.CompareToReferenceOutput(
|
|
GetImageComparer(provider),
|
|
provider,
|
|
appendPixelTypeToFileName: false);
|
|
}
|
|
|
|
string dump = BasicSerializer.Serialize(provider);
|
|
RemoteExecutor.Invoke(RunTest, dump).Dispose();
|
|
}
|
|
}
|
|
}
|
|
|