Josh Collins
12/28/2004 3:10:00 AM
I am writing a windows service in C# to wait for image files to be
created into a directory and then manipulate them. I am receiving out
of memory errors upon loading the files.
I am copying these files to the machine from another PC on the network
to a shared folder.
I've read that this exception can be thrown when the format is not
recognized by the framework. The issue is that it all works file when
the file is copied locally from on the PC, but the memory exceptions
come when the files are copied from a remote machine.
Below is a snippet. Any help would be greatly appreciated!
Thanks,
josh
try {
Image newImage = Image.FromFile(e.FullPath);
logInfo(e.FullPath + " --- " + newImage.Height + " x " +
newImage.Width + " -- " + newImage.VerticalResolution + " x " +
newImage.HorizontalResolution);
newImage.Dispose();
newImage = null;
} catch (Exception e1) {
logError(e1);
}