diff --git a/src/ImageSharp/Image/PixelArea{TColor}.cs b/src/ImageSharp/Image/PixelArea{TColor}.cs
index 2f631f66e..673fe5500 100644
--- a/src/ImageSharp/Image/PixelArea{TColor}.cs
+++ b/src/ImageSharp/Image/PixelArea{TColor}.cs
@@ -79,6 +79,17 @@ namespace ImageSharp
this.PixelBase = (byte*)this.dataPointer.ToPointer();
}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The width.
+ /// The height.
+ /// The component order.
+ public PixelArea(int width, int height, ComponentOrder componentOrder)
+ : this(width, height, componentOrder, 0)
+ {
+ }
+
///
/// Initializes a new instance of the class.
///
diff --git a/tests/ImageSharp.Tests/FileTestBase.cs b/tests/ImageSharp.Tests/FileTestBase.cs
index 38a499a02..e0e84dbda 100644
--- a/tests/ImageSharp.Tests/FileTestBase.cs
+++ b/tests/ImageSharp.Tests/FileTestBase.cs
@@ -46,6 +46,9 @@ namespace ImageSharp.Tests
// TestFile.Create(TestImages.Gif.Giphy) // Perf: Enable for local testing only
};
+ // TODO: Find a better place for this
+ internal const string TestOutputRoot = "TestOutput/";
+
protected string CreateOutputDirectory(string path, params string[] pathParts)
{
var postFix = "";
@@ -54,7 +57,7 @@ namespace ImageSharp.Tests
postFix = "/" + string.Join("/", pathParts);
}
- path = "TestOutput/" + path + postFix;
+ path = TestOutputRoot + path + postFix;
if (!Directory.Exists(path))
{
diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegTests.cs
index 08efe5c89..85bc18d11 100644
--- a/tests/ImageSharp.Tests/Formats/Jpg/JpegTests.cs
+++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegTests.cs
@@ -6,7 +6,7 @@ using ImageSharp.Formats;
using Xunit;
using Xunit.Abstractions;
-namespace ImageSharp.Tests.Formats.Jpg
+namespace ImageSharp.Tests
{
public class JpegTests
{
@@ -17,62 +17,45 @@ namespace ImageSharp.Tests.Formats.Jpg
public JpegTests(ITestOutputHelper output)
{
- Output = output;
+ this.Output = output;
}
+ public static IEnumerable AllJpegFiles => TestImages.Jpeg.All;
- protected string CreateTestOutputFile(string fileName)
- {
- if (!Directory.Exists(TestOutputDirectory))
- {
- Directory.CreateDirectory(TestOutputDirectory);
- }
-
- //string id = Guid.NewGuid().ToString().Substring(0, 4);
-
- string ext = Path.GetExtension(fileName);
- fileName = Path.GetFileNameWithoutExtension(fileName);
-
- return $"{TestOutputDirectory}/{fileName}{ext}";
- }
-
- protected Stream CreateOutputStream(string fileName)
- {
- fileName = CreateTestOutputFile(fileName);
- Output?.WriteLine("Opened for write: "+fileName);
- return File.OpenWrite(fileName);
- }
-
- public static IEnumerable