예제 #1
0
 public void CanReadTiffHeader(string filename, uint firstIfdOffset)
 {
     using (var stream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read))
     {
         var tiffStream = new TiffStreamReader(stream);
         var ifd0       = tiffStream.ReadHeader();
         Assert.Equal(firstIfdOffset, ifd0);
     }
 }
예제 #2
0
        public void CanReadRawIFD0Tags(string filename, int firstIfdTags, uint nextIfdOffset)
        {
            using (var stream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                var tiffStream = new TiffStreamReader(stream);
                var ifd0       = tiffStream.ReadIFD(tiffStream.ReadHeader());

                Assert.Equal(firstIfdTags, ifd0.tags.Length);
                Assert.Equal(nextIfdOffset, ifd0.nextIfd);
            }
        }
예제 #3
0
        public void CanParseIFD0Tags()
        {
            using (var stream = new FileStream(SamplesList.LAB, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                var tiffStream = new TiffStreamReader(stream);
                var ifd0       = tiffStream.ParseIFD(tiffStream.ReadHeader());

                Assert.Equal("NIKON D90", ifd0.tags[7].GetString());
                Assert.Equal(8, ifd0.tags[3].GetValue <short>(2));
                Assert.Equal(2991224u, ifd0.tags[22].GetValue <uint>(0));
            }
        }