Пример #1
0
        public void Decode_IgnoreMetadataIsTrue_TextChunksAreIgnored()
        {
            PngDecoderOptions options = new PngDecoderOptions()
            {
                IgnoreMetadata = true
            };

            TestFile testFile = TestFile.Create(TestImages.Png.Blur);

            using (Image image = testFile.CreateImage(options))
            {
                Assert.Equal(0, image.MetaData.Properties.Count);
            }
        }
Пример #2
0
        public void Decode_TextEncodingSetToUnicode_TextIsReadWithCorrectEncoding()
        {
            PngDecoderOptions options = new PngDecoderOptions()
            {
                TextEncoding = Encoding.Unicode
            };

            TestFile testFile = TestFile.Create(TestImages.Png.Blur);

            using (Image image = testFile.CreateImage(options))
            {
                Assert.Equal(1, image.MetaData.Properties.Count);
                Assert.Equal("潓瑦慷敲", image.MetaData.Properties[0].Name);
            }
        }
Пример #3
0
        public void Decode_IgnoreMetadataIsFalse_TextChunckIsRead()
        {
            PngDecoderOptions options = new PngDecoderOptions()
            {
                IgnoreMetadata = false
            };

            TestFile testFile = TestFile.Create(TestImages.Png.Blur);

            using (Image image = testFile.CreateImage(options))
            {
                Assert.Equal(1, image.MetaData.Properties.Count);
                Assert.Equal("Software", image.MetaData.Properties[0].Name);
                Assert.Equal("paint.net 4.0.6", image.MetaData.Properties[0].Value);
            }
        }