private void ReadPages() { Int16 imageNumber = _tiff.NumberOfDirectories(); _images.EnsureCapacity(imageNumber * 2); do { String pageName = _reader.PageName; if (pageName.StartsWith("Image")) { ReadColorMap(pageName); ReadImage(); } else if (pageName.StartsWith("Palette")) { ReadPalette(); } else { throw new NotSupportedException(pageName); } } while (_tiff.ReadDirectory()); }