2005.12.03 14:46 "[Tiff] Call for OJPEG test images", by Joris Van Damme

2006.01.10 16:46 "Re: [Tiff] Problem closing TFF file : First Chance exception", by Joris Van Damme


Please mail plain text messages only to mailing lists.

I try to use libtiff library with a Console Win32 Project and I’ve a problem to close an existing TIFF file.

I just do:

In = TIFFOpen(“temp.tif”,”r”);


I’ve an error on TIFFClose: First-Chance exception in test.exe

> (NTDLL.DLL): 0x0000008: Invalid Handle

Chances are this is because you've never received a proper TIFF* in the first place as a return of TIFFOpen, because the "temp.tif" wasn't found. Add an error check, like this.

TIFF *in;
In = TIFFOpen(“temp.tif”,”r”);
if (In==NULL)
  /* some error occured */

Probably things work better if you pass a full filename with complete path.

For more information on TIFFOpen, including error return value, see http://www.remotesensing.org/libtiff/man/TIFFOpen.3tiff.html.

Joris Van Damme
Download your free TIFF tag viewer for windows here: