AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
January 2006

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2006.01.10 16:19 "Problem closing TFF file : First Chance exception", by <tub95@wanadoo.fr>
2006.01.10 16:34 "Re: Problem closing TFF file : First Chance exception", by Bernie Pallek
2006.01.11 08:57 "Re: Problem closing TFF file : First Chance exception", by <tub95@wanadoo.fr>
2006.01.11 14:58 "Re: Problem closing TFF file : First Chance exception", by Bernie Pallek
2006.01.11 16:30 "Re: Problem closing TFF file : First Chance exception", by Bernie Pallek
2006.01.10 16:46 "Re: Problem closing TFF file : First Chance exception", by Joris Van Damme
2006.01.10 16:51 "Re: Problem closing TFF file : First Chance exception", by Bernie Pallek
2006.01.11 08:48 "Re: Problem closing TFF file : First Chance exception", by <tub95@wanadoo.fr>
2006.01.16 11:02 "Re: Problem closing TFF file : First Chance exception", by <tub95@wanadoo.fr>

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

Bogoss,

Please mail plain text messages only to mailing lists.

Bogoss wrote:
> 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 :
>
> TIFF *in;
> In = TIFFOpen("temp.tif","r");
> TIFFClose(in);
>
> 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 */
  ...
else
  TIFFClose(in);

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
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html