public static bool Initialize() { Ghostscript.Initialize(); var configFiles = ConfigurationFiles.Default; configFiles.Policy.Data = ModifyPolicy(configFiles.Policy.Data); configFiles.Type.Data = CreateTypeData(); var path = Path.Combine(Path.GetTempPath(), "Magick.NET.Tests"); Cleanup.DeleteDirectory(path); Directory.CreateDirectory(path); MagickNET.Initialize(configFiles, path); // OpenCL should be disabled by default this is a hack to check that. if (OpenCL.IsEnabled) { return(false); } OpenCL.IsEnabled = true; return(true); }
public IEnumerable <ITestCollection> OrderTestCollections(IEnumerable <ITestCollection> testCollections) { Ghostscript.Initialize(); var configFiles = ConfigurationFiles.Default; configFiles.Policy.Data = ModifyPolicy(configFiles.Policy.Data); configFiles.Type.Data = CreateTypeData(); var path = Path.Combine(Path.GetTempPath(), "Magick.NET.Tests"); Cleanup.DeleteDirectory(path); Directory.CreateDirectory(path); MagickNET.Initialize(configFiles, path); return(testCollections); }
public void Test_FitPage() { Ghostscript.Initialize(); MagickReadSettings settings = new MagickReadSettings() { Defines = new PdfReadDefines() { FitPage = new MagickGeometry(50, 40) } }; using (MagickImage image = new MagickImage()) { image.Read(Files.Coders.CartoonNetworkStudiosLogoAI, settings); Assert.IsTrue(image.Width <= 50); Assert.IsTrue(image.Height <= 40); } }