Browse Source

Add resolution test

Test Fails just now.


Former-commit-id: da297b15e6ad9c6612378499e7506fade95174d8
Former-commit-id: 9c6106412771f797166983014b7cc976bdae3a3a
Former-commit-id: 394581f30c0ef3e6beb50e32984d8b5315e81710
pull/1/head
James Jackson-South 10 years ago
parent
commit
a782e5fe49
  1. 39
      tests/ImageProcessorCore.Tests/Formats/Jpg/JpegFileTests.cs

39
tests/ImageProcessorCore.Tests/Formats/Jpg/JpegFileTests.cs

@ -0,0 +1,39 @@
// <copyright file="SamplerTests.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
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);
}
}
}
}
}
}
Loading…
Cancel
Save