2001.08.28 08:20 "unhandled exception while trying to open a tiff file", by Seydou Wane

2001.08.28 19:14 "Re: unhandled exception while trying to open a tiff file", by Peter Montgomery


I'm using the libtiff version v3.5.6 (Beta) under MSVC++ 6.0. I get this following message while trying to open a tiff file with the instruction TIFF* tiff = TiffOpen(myFile,"r"):

Undhandled exception in myAppli.exe (NTDLL.DLL): 0xC0000005: Access violation.

Most of my tiff files work correctly with the instruction above, but others don't. All the files have the same attributs and the same compression algorithm.

You haven't really given people much information to work with. And access violation simply means you're trying to read or write to memory that doesn't belong to your application. This could be caused by any number of things. What steps have you taken to isolate the problem? I recommend you try something like this in your code...

TIFF* tiff = TiffOpen(myFile,"r"):

if (tiff ){
  TIFFClose(tiff );


Don't write a new application, just stick this code into your existing application and see what happens. You need to first verify that all your other code isn't causing a problem. Another member on the list once suggest using "ru" instead of "r" for a similar problem. You could give that a try as well. Finally, can you open the file in question with another program such as PhotoShop? Make sure the file isn't corrupt or screwing things up in some way.