From 52a126c0efd163a2c24f2fb2ebdeaf9de0e4ba7b Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 27 Jul 2016 17:55:22 +1000 Subject: [PATCH] Add resolution test Test Fails just now. Former-commit-id: da297b15e6ad9c6612378499e7506fade95174d8 Former-commit-id: 9c6106412771f797166983014b7cc976bdae3a3a Former-commit-id: 394581f30c0ef3e6beb50e32984d8b5315e81710 --- .../Formats/Jpg/JpegFileTests.cs | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/ImageProcessorCore.Tests/Formats/Jpg/JpegFileTests.cs 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