mirror of https://github.com/SixLabors/ImageSharp
4 changed files with 73 additions and 89 deletions
@ -1,25 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Text; |
|
||||
|
|
||||
namespace ImageSharp.Tests.TestUtilities.Integration |
|
||||
{ |
|
||||
using System.IO; |
|
||||
|
|
||||
using ImageSharp.Formats; |
|
||||
using ImageSharp.PixelFormats; |
|
||||
|
|
||||
public class ReferencePngEncoder : IImageEncoder |
|
||||
{ |
|
||||
public static ReferencePngEncoder Instance { get; } = new ReferencePngEncoder(); |
|
||||
|
|
||||
public void Encode<TPixel>(Image<TPixel> image, Stream stream, IEncoderOptions options) |
|
||||
where TPixel : struct, IPixel<TPixel> |
|
||||
{ |
|
||||
using (System.Drawing.Bitmap sdBitmap = IntegrationTestUtils.ToSystemDrawingBitmap(image)) |
|
||||
{ |
|
||||
sdBitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,20 @@ |
|||||
|
namespace ImageSharp.Tests |
||||
|
{ |
||||
|
using System; |
||||
|
|
||||
|
public static class TestEnvironment |
||||
|
{ |
||||
|
private static Lazy<bool> runsOnCi = new Lazy<bool>( |
||||
|
() => |
||||
|
{ |
||||
|
bool isCi; |
||||
|
return bool.TryParse(Environment.GetEnvironmentVariable("CI"), out isCi) && isCi; |
||||
|
}); |
||||
|
|
||||
|
// ReSharper disable once InconsistentNaming
|
||||
|
/// <summary>
|
||||
|
/// Gets a value indicating whether test execution runs on CI.
|
||||
|
/// </summary>
|
||||
|
internal static bool RunsOnCI => runsOnCi.Value; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue