From 5e0c77b9524413783f270f97d798c6ef6aec0857 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Thu, 4 Jul 2024 20:30:45 +0200 Subject: [PATCH] Added unit test for issue #1663. --- tests/Magick.NET.Tests/Coders/TheEpsCoder.cs | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/Magick.NET.Tests/Coders/TheEpsCoder.cs b/tests/Magick.NET.Tests/Coders/TheEpsCoder.cs index 72fb80dfca..58cfd46679 100644 --- a/tests/Magick.NET.Tests/Coders/TheEpsCoder.cs +++ b/tests/Magick.NET.Tests/Coders/TheEpsCoder.cs @@ -28,6 +28,27 @@ public void ShouldReadTwoImages() Assert.Equal(MagickFormat.Tiff, images[1].Format); } + [Fact] + public void ShouldReadMonoChromeImageWhenUseMonochromeIsTrue() + { + if (!Ghostscript.IsAvailable) + return; + + var settings = new MagickReadSettings + { + UseMonochrome = true, + }; + + using var image = new MagickImage(Files.Coders.SwedenHeartEPS, settings); + + Assert.Equal(447, image.Width); + Assert.Equal(420, image.Height); + ColorAssert.Equal(MagickColors.Black, image, 223, 61); + ColorAssert.Equal(MagickColors.Black, image, 263, 255); + ColorAssert.Equal(MagickColors.White, image, 223, 62); + ColorAssert.Equal(MagickColors.White, image, 193, 254); + } + [Fact] public void ShouldReadClipPathsInTiffPreview() {