Overview:
I have an issue where 1 out of a hundred PCs just started having an issue with the LibTiff library not wanting to open ANY of my tiff images. I suspect it has to do with a dependency file that has changed. I have seen this issue before but can not remember how I solved the issue (I think I replaced some dll files with ones from another PC that was working). I tried to use Dependency Walker to determine what files were used by the LibTiff.Net dll but could not get Dependency Walker to work, it just had errors opening a bunch of dlls.
Question:
Is it possible to know WHY a file is not being opened successfully? All the method does is return NULL, is there a way to get an error of some type? I know there are no locks on the files (did a reboot, and checked other ways). I know the tiff files are good with no issues (copied them to another PC that uses the same software and it reads it just fine). Could I use something like "GetLastError" to return a reason the Open method is returning Null?
Here is my current usage:
using BitMiracle.LibTiff.Classic;
using (Tiff tImage = Tiff.Open(sFileName, "r"))
{
if (tImage == null)
{
//File could not be opened
lastError = "File could not be opened.";
return null;
}
}