I am procesing some product images in my console app and some the images seem to be corrupted.
I firstly check if the file exists
try
{
if(File.Exists(filepath)==true)
{
//process it
GenerateImage(filePath);
//notify user using my own email utility class
//EmailUtil.SendEmail(userId)
}
}
catch(.......)
{
Console.WriteLine(ex.message);
}
I get an exception:
"Parameter is not valid".
When i go to view the image in my ProductImages folder and select the image that is causing the issue I get the following:
"Windows Photo Viewer cannot open this file since the file is empty."
Is there an inbuilt functionality available in the .NET framework by any chance to not to process corrupted images? Or do I have to ensure I dont deal with corrupted images in the first place?
Any thoughts on the above would be much appreciated.
Thanks in advance
This post has been edited by MarmiteX1: 13 January 2011 - 06:03 AM

New Topic/Question
Reply




MultiQuote





|