diff --git a/src/ImageSharp46/Formats/Jpg/JpegDecoderCore.cs b/src/ImageSharp46/Formats/Jpg/JpegDecoderCore.cs index 332dcec488..a1e5966499 100644 --- a/src/ImageSharp46/Formats/Jpg/JpegDecoderCore.cs +++ b/src/ImageSharp46/Formats/Jpg/JpegDecoderCore.cs @@ -220,6 +220,7 @@ namespace ImageSharp.Formats } } + /// /// Decodes the image from the specified this._stream and sets /// the data to image. diff --git a/tests/ImageSharp.Tests46/Benchmark/DecodeJpeg.cs b/tests/ImageSharp.Tests46/Benchmark/DecodeJpeg.cs index cd32e78297..968ca070f8 100644 --- a/tests/ImageSharp.Tests46/Benchmark/DecodeJpeg.cs +++ b/tests/ImageSharp.Tests46/Benchmark/DecodeJpeg.cs @@ -2,6 +2,7 @@ using System.Diagnostics; using System.IO; using System.Runtime.CompilerServices; +using ImageSharp.Tests; using Xunit; using Xunit.Abstractions; @@ -15,7 +16,7 @@ namespace ImageSharp.Tests46.Benchmark public class DecodeJpeg { - private static byte[] jpegBytes = File.ReadAllBytes("../../TestImages/Formats/Jpg/Calliphora.jpg"); + private static byte[] jpegBytes = File.ReadAllBytes(TestImages.Jpeg.Calliphora); private ITestOutputHelper _output; @@ -60,8 +61,9 @@ namespace ImageSharp.Tests46.Benchmark { DoBenchmark(times, memoryStream => { - CoreImage image = new CoreImage(memoryStream); ; + CoreImage image = new CoreImage(memoryStream); }); } + } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests46/Formats/Png/PngTests.cs b/tests/ImageSharp.Tests46/Formats/Png/PngTests.cs index c442b71c97..165a32ec95 100644 --- a/tests/ImageSharp.Tests46/Formats/Png/PngTests.cs +++ b/tests/ImageSharp.Tests46/Formats/Png/PngTests.cs @@ -13,6 +13,8 @@ namespace ImageSharp.Tests public class PngTests : FileTestBase { + + [Fact] public void ImageCanSaveIndexedPng() { diff --git a/tests/ImageSharp.Tests46/ImageSharp.Tests46.csproj b/tests/ImageSharp.Tests46/ImageSharp.Tests46.csproj index 843e5c4b5c..194d84be8c 100644 --- a/tests/ImageSharp.Tests46/ImageSharp.Tests46.csproj +++ b/tests/ImageSharp.Tests46/ImageSharp.Tests46.csproj @@ -72,6 +72,7 @@ + diff --git a/tests/ImageSharp.Tests46/JpegSandbox.cs b/tests/ImageSharp.Tests46/JpegSandbox.cs new file mode 100644 index 0000000000..425d9193b9 --- /dev/null +++ b/tests/ImageSharp.Tests46/JpegSandbox.cs @@ -0,0 +1,44 @@ +using System; +using System.IO; +using ImageSharp.Formats; +using Xunit; + +namespace ImageSharp.Tests +{ + public class JpegSandbox + { + public const string SandboxOutputDirectory = "_SandboxOutput"; + + protected string CreateTestOutputFile(string fileName) + { + if (!Directory.Exists(SandboxOutputDirectory)) + { + Directory.CreateDirectory(SandboxOutputDirectory); + } + + string id = Guid.NewGuid().ToString().Substring(0, 4); + + string ext = Path.GetExtension(fileName); + fileName = Path.GetFileNameWithoutExtension(fileName); + + return $"{SandboxOutputDirectory}/{fileName}_{id}{ext}"; + } + + protected Stream CreateOutputStream(string fileName) + { + fileName = CreateTestOutputFile(fileName); + return File.OpenWrite(fileName); + } + + [Fact] + public void OpenJpeg_SaveBmp() + { + var image = new TestFile(TestImages.Jpeg.Calliphora).CreateImage(); + + using (var stream = CreateOutputStream(nameof(OpenJpeg_SaveBmp)+".bmp")) + { + image.Save(stream, new BmpFormat()); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests46/Processors/Filters/BoxBlurTest.cs b/tests/ImageSharp.Tests46/Processors/Filters/BoxBlurTest.cs index 4755acb1e5..453d568634 100644 --- a/tests/ImageSharp.Tests46/Processors/Filters/BoxBlurTest.cs +++ b/tests/ImageSharp.Tests46/Processors/Filters/BoxBlurTest.cs @@ -9,6 +9,7 @@ namespace ImageSharp.Tests using Xunit; + public class BoxBlurTest : FileTestBase { public static readonly TheoryData BoxBlurValues