예제 #1
0
        public void LoadTest078()
        {
            string file = Path.Combine(Util.ArtifactsPath, "test078C.djvu");

            using (DjvuDocument document = new DjvuDocument())
            {
                int hash = file.GetHashCode();
                document.Load(file, hash);
                Assert.Equal(hash, document.Identifier);
                IDjvuPage page = document.ActivePage;

                PM44Chunk pmChunk = page.PageForm.Children[0] as PM44Chunk;
                Assert.IsType <PM44Chunk>(pmChunk);

                var img = pmChunk.Image;
                Assert.NotNull(img);

                var pixMap = new Wavelet.InterWavePixelMapDecoder();
                pixMap = pmChunk.ProgressiveDecodeBackground(pixMap) as Wavelet.InterWavePixelMapDecoder;
                Assert.NotNull(pixMap);

                pmChunk = page.PageForm.Children[1] as PM44Chunk;
                Assert.NotNull(pmChunk);

                var pixMap2 = new Wavelet.InterWavePixelMapDecoder();
                Assert.Throws <DjvuFormatException>(() => pmChunk.ProgressiveDecodeBackground(pixMap2));

                // This time call will not throw
                pmChunk.ProgressiveDecodeBackground(pixMap);
            }
        }
예제 #2
0
        public void LoadTest039()
        {
            string file = Util.GetTestFilePath(39);

            using (DjvuDocument document = new DjvuDocument())
            {
                int hash = file.GetHashCode();
                document.Load(file, hash);
                Assert.Equal(hash, document.Identifier);
            }
        }
예제 #3
0
        public void LoadTest002()
        {
            DjvuDocument document = null;

            document = new DjvuDocument();
            string testFile = Util.GetTestFilePath(2);

            try
            {
                document.Load(testFile);
                Assert.NotNull(document.Pages);
                Assert.NotEmpty(document.Pages);
            }
            finally
            {
                document?.Dispose();
            }
        }