Browse Source

Remove `ImageHelpers` class and Magick.NET dependency from conformance tests.

Marcin Ziąbek 1 week ago
parent
commit
55b7a982d1
1 changed files with 0 additions and 48 deletions
  1. 0 48
      Source/QuestPDF.ConformanceTests/TestEngine/ImageHelpers.cs

+ 0 - 48
Source/QuestPDF.ConformanceTests/TestEngine/ImageHelpers.cs

@@ -1,48 +0,0 @@
-using ImageMagick;
-
-namespace QuestPDF.ConformanceTests.TestEngine;
-
-public static class ImageHelpers
-{
-    public static void ConvertImageIccColorSpaceProfileToVersion2(Stream inputStream, Stream outputStream)
-    {
-        using var image = new MagickImage(inputStream);
-        var iccVersion = GetIccProfileVersion();
-
-        if (iccVersion == 2)
-        {
-            image.Write(outputStream);
-            return;
-        }
-
-        if (iccVersion != null)
-            image.RemoveProfile("icc");
-        
-        image.ColorSpace = ColorSpace.sRGB;
-        image.SetProfile(ColorProfile.SRGB);
-        
-        image.Write(outputStream);
-
-        int? GetIccProfileVersion()
-        {
-            var imageProfile = image.GetProfile("icc");
- 
-            if (imageProfile == null)
-                return null;
-            
-            var imageProfileRaw = imageProfile.ToByteArray();
-
-            if (imageProfileRaw.Length < 12)
-                return null;
-            
-            return imageProfileRaw[8];
-        }
-    }
-
-    public static void ConvertImageIccColorSpaceProfileToVersion2(string inputPath, string outputPath)
-    {
-        using var inputStream = File.OpenRead(inputPath);
-        using var outputStream = File.OpenWrite(outputPath);
-        ConvertImageIccColorSpaceProfileToVersion2(inputStream, outputStream);
-    }
-}