My application has to handle TIFF files that are stored in a MemoryStream, but LibTiff.Net always returns null
for the field values.
MemoryStream ms = new MemoryStream();
FileStream fs = new FileStream("testfile.tif", FileMode.Open);
fs.CopyTo(ms);
//It seems (memory) streams have to be opened in write mode, "r" always returns <null>
Tiff tiff = Tiff.ClientOpen("someArbitraryName", "w", ms, new TiffStream());
FieldValue[] imageHeight = tif.GetField(TiffTag.IMAGELENGTH);
Opening the file directly for reading using Tiff.Open
works fine.
Is this a bug in the LibTiff.Net library or am I missing something?