diff --git a/tests/ImageProcessorCore.Tests/Formats/Jpg/JpegFileTests.cs b/tests/ImageProcessorCore.Tests/Formats/Jpg/JpegFileTests.cs new file mode 100644 index 000000000..ae10b6cbd --- /dev/null +++ b/tests/ImageProcessorCore.Tests/Formats/Jpg/JpegFileTests.cs @@ -0,0 +1,39 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageProcessorCore.Tests +{ + using System.IO; + + using Xunit; + + public class JpegFileTests : FileTestBase + { + [Fact] + public void ResolutionShouldChange() + { + if (!Directory.Exists("TestOutput/Resolution")) + { + Directory.CreateDirectory("TestOutput/Resolution"); + } + + foreach (string file in Files) + { + using (FileStream stream = File.OpenRead(file)) + { + string filename = Path.GetFileName(file); + + Image image = new Image(stream); + using (FileStream output = File.OpenWrite($"TestOutput/Resolution/{filename}")) + { + image.VerticalResolution = 150; + image.HorizontalResolution = 150; + image.Save(output); + } + } + } + } + } +} \ No newline at end of file