| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2006.01.10 16:46 "Re: Problem closing TFF file : First Chance exception", by Joris Van DammeBogoss,
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
|
|||||||