Skip to content

Commit

Permalink
Added unit tests for #1210.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Jul 11, 2022
1 parent b721c4d commit a46787f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/Magick.NET.Tests/Coders/ThePdfCoder.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
// Licensed under the Apache License, Version 2.0.

using System.IO;
using System.Threading.Tasks;
using ImageMagick;
using Xunit;
Expand Down Expand Up @@ -37,5 +38,26 @@ public void ShouldReadFileMultithreadedCorrectly()
results[i].Wait();
}
}

[Fact]
public void ShouldWriteTiffImageInCorrectColor()
{
if (!Ghostscript.IsAvailable)
return;

using (var input = new MagickImage(Files.Coders.PixelTIF))
{
using (var memorystream = new MemoryStream())
{
input.Write(memorystream, MagickFormat.Tiff);
memorystream.Position = 0;

using (var output = new MagickImage(memorystream))
{
ColorAssert.Equal(MagickColors.White, output, 0, 0);
}
}
}
}
}
}
Binary file added tests/Magick.NET.Tests/Images/Coders/Pixel.tif
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/Shared/Files.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ public static string PageTIF
public static string PdfExamplePasswordOriginalPDF
=> Root + @"Images/Coders/pdf-example-password.original.pdf";

public static string PixelTIF
=> Root + @"Images/Coders/Pixel.tif";

public static string PlayerPSD
=> Root + @"Images/Coders/Player.psd";

Expand Down

0 comments on commit a46787f

Please sign in to comment.