Ejemplo n.º 1
0
        public void Test_Properties()
        {
            MagickFormatInfo formatInfo = MagickNET.GetFormatInformation(MagickFormat.Gradient);

            Assert.IsNotNull(formatInfo);
            Assert.AreEqual(MagickFormat.Gradient, formatInfo.Format);
            Assert.AreEqual(true, formatInfo.CanReadMultithreaded);
            Assert.AreEqual(true, formatInfo.CanWriteMultithreaded);
            Assert.AreEqual("Gradual linear passing from one shade to another", formatInfo.Description);
            Assert.AreEqual(false, formatInfo.IsMultiFrame);
            Assert.AreEqual(true, formatInfo.IsReadable);
            Assert.AreEqual(false, formatInfo.IsWritable);
            Assert.AreEqual(null, formatInfo.MimeType);

            formatInfo = MagickNET.GetFormatInformation(MagickFormat.Jp2);
            Assert.IsNotNull(formatInfo);
            Assert.AreEqual(MagickFormat.Jp2, formatInfo.Format);
            Assert.AreEqual(true, formatInfo.CanReadMultithreaded);
            Assert.AreEqual(true, formatInfo.CanWriteMultithreaded);
            Assert.AreEqual("JPEG-2000 File Format Syntax", formatInfo.Description);
            Assert.AreEqual(false, formatInfo.IsMultiFrame);
            Assert.AreEqual(true, formatInfo.IsReadable);
            Assert.AreEqual(true, formatInfo.IsWritable);
            Assert.AreEqual("image/jp2", formatInfo.MimeType);

            formatInfo = MagickNET.GetFormatInformation(MagickFormat.Jpg);
            Assert.IsNotNull(formatInfo);
            Assert.AreEqual(true, formatInfo.CanReadMultithreaded);
            Assert.AreEqual(true, formatInfo.CanWriteMultithreaded);
            Assert.AreEqual("Joint Photographic Experts Group JFIF format", formatInfo.Description);
            Assert.AreEqual(MagickFormat.Jpg, formatInfo.Format);
            Assert.AreEqual(false, formatInfo.IsMultiFrame);
            Assert.AreEqual(true, formatInfo.IsReadable);
            Assert.AreEqual(true, formatInfo.IsWritable);
            Assert.AreEqual("image/jpeg", formatInfo.MimeType);
            Assert.AreEqual(MagickFormat.Jpeg, formatInfo.Module);

            formatInfo = MagickNET.GetFormatInformation(MagickFormat.Png);
            Assert.IsNotNull(formatInfo);
            Assert.AreEqual(true, formatInfo.CanReadMultithreaded);
            Assert.AreEqual(true, formatInfo.CanWriteMultithreaded);
            Assert.AreEqual("Portable Network Graphics", formatInfo.Description);
            Assert.AreEqual(MagickFormat.Png, formatInfo.Format);
            Assert.AreEqual(false, formatInfo.IsMultiFrame);
            Assert.AreEqual(true, formatInfo.IsReadable);
            Assert.AreEqual(true, formatInfo.IsWritable);
            Assert.AreEqual("image/png", formatInfo.MimeType);
            Assert.AreEqual(MagickFormat.Png, formatInfo.Module);

            formatInfo = MagickNET.GetFormatInformation(MagickFormat.Xps);
            Assert.IsNotNull(formatInfo);
            Assert.AreEqual(false, formatInfo.CanReadMultithreaded);
            Assert.AreEqual(false, formatInfo.CanWriteMultithreaded);
            Assert.AreEqual("Microsoft XML Paper Specification", formatInfo.Description);
            Assert.AreEqual(MagickFormat.Xps, formatInfo.Format);
            Assert.AreEqual(false, formatInfo.IsMultiFrame);
            Assert.AreEqual(true, formatInfo.IsReadable);
            Assert.AreEqual(false, formatInfo.IsWritable);
            Assert.IsNull(formatInfo.MimeType);
            Assert.AreEqual(MagickFormat.Xps, formatInfo.Module);
        }
        public void Test_Properties()
        {
            var formatInfo = MagickNET.GetFormatInformation(MagickFormat.Gradient);

            Assert.NotNull(formatInfo);
            Assert.Equal(MagickFormat.Gradient, formatInfo.Format);
            Assert.True(formatInfo.CanReadMultithreaded);
            Assert.True(formatInfo.CanWriteMultithreaded);
            Assert.Equal("Gradual linear passing from one shade to another", formatInfo.Description);
            Assert.False(formatInfo.IsMultiFrame);
            Assert.True(formatInfo.IsReadable);
            Assert.False(formatInfo.IsWritable);
            Assert.Null(formatInfo.MimeType);

            formatInfo = MagickNET.GetFormatInformation(MagickFormat.Jp2);
            Assert.NotNull(formatInfo);
            Assert.Equal(MagickFormat.Jp2, formatInfo.Format);
            Assert.True(formatInfo.CanReadMultithreaded);
            Assert.True(formatInfo.CanWriteMultithreaded);
            Assert.Equal("JPEG-2000 File Format Syntax", formatInfo.Description);
            Assert.False(formatInfo.IsMultiFrame);
            Assert.True(formatInfo.IsReadable);
            Assert.True(formatInfo.IsWritable);
            Assert.Equal("image/jp2", formatInfo.MimeType);

            formatInfo = MagickNET.GetFormatInformation(MagickFormat.Jpg);
            Assert.NotNull(formatInfo);
            Assert.True(formatInfo.CanReadMultithreaded);
            Assert.True(formatInfo.CanWriteMultithreaded);
            Assert.Equal("Joint Photographic Experts Group JFIF format", formatInfo.Description);
            Assert.Equal(MagickFormat.Jpg, formatInfo.Format);
            Assert.False(formatInfo.IsMultiFrame);
            Assert.True(formatInfo.IsReadable);
            Assert.True(formatInfo.IsWritable);
            Assert.Equal("image/jpeg", formatInfo.MimeType);
            Assert.Equal(MagickFormat.Jpeg, formatInfo.ModuleFormat);

            formatInfo = MagickNET.GetFormatInformation(MagickFormat.Png);
            Assert.NotNull(formatInfo);
            Assert.True(formatInfo.CanReadMultithreaded);
            Assert.True(formatInfo.CanWriteMultithreaded);
            Assert.Equal("Portable Network Graphics", formatInfo.Description);
            Assert.Equal(MagickFormat.Png, formatInfo.Format);
            Assert.False(formatInfo.IsMultiFrame);
            Assert.True(formatInfo.IsReadable);
            Assert.True(formatInfo.IsWritable);
            Assert.Equal("image/png", formatInfo.MimeType);
            Assert.Equal(MagickFormat.Png, formatInfo.ModuleFormat);

            formatInfo = MagickNET.GetFormatInformation(MagickFormat.Pango);
            Assert.NotNull(formatInfo);
            Assert.False(formatInfo.CanReadMultithreaded);
            Assert.False(formatInfo.CanWriteMultithreaded);
            Assert.Equal("Pango Markup Language", formatInfo.Description);
            Assert.Equal(MagickFormat.Pango, formatInfo.Format);
            Assert.False(formatInfo.IsMultiFrame);
            Assert.True(formatInfo.IsReadable);
            Assert.False(formatInfo.IsWritable);
            Assert.Null(formatInfo.MimeType);
            Assert.Equal(MagickFormat.Pango, formatInfo.ModuleFormat);
        }
Ejemplo n.º 3
0
        protected override string GetMimeType()
        {
            MagickFormatInfo formatInfo = MagickNET.GetFormatInformation(_scriptResolver.OutputFormat);

            return(formatInfo.MimeType);
        }