2007.05.17 08:53 "[Tiff] Using LibTIFF from C#", by


I am trying to load a tif file (LaB 16 bit, but 8bit LaB and 8bit RGB don't

work either) from within C#.

I can load the file using TIFFOpen:

IntPtr tiffFile;
tiffFile = TIFF.TIFFOpen(new StringBuilder("C:\\test8rgb.tif"), new

That seems to work, but then calling the TIFFRead... functions closes the

program without any warning.

int scanLineSize = TIFF.TIFFScanlineSize(tiffFile);
byte[] tempTest = new byte[stripSize];

TIFF.TIFFReadScanline(tiffFile, ref tempTest, 1, 1);

The only thing I can think, is that the function is trying to access memory

outside of its bounds, and .NET doesn't like it doing that and exits,

although I am not at all certain that is what is happening.

Hopefully I am just missing something fairly simple.

Thanks for any help anyone can give me.



The information in this document and attachments is given after the exercise of all reasonable care and skill in its compilation, preparation and issue, but is provided without liability in its application or use. It may contain privileged information that is exempt from disclosure by law and may be confidential. If you are not the intended recipient you must not copy, distribute or take any action in reliance on it. If you have received this document in error please notify us and delete this message from your system immediately.

The CCFRA Group includes Campden & Chorleywood Food Research Association (Reg. No. 510618), CCFRA Group Services Ltd. (3841905) and CCFRA Technology Ltd. (3836922) all registered in England with the registered office at Chipping Campden, Gloucestershire, GL55 6LD.

The Group reserves the right to monitor e-mail communications passing through its network. Any advice given is subject to our normal terms and conditions of trading, a copy of which is available on request.


This e-mail has been scanned for all viruses by MessageLabs.