I have an external dll that provides the time and date a photo has been taken
I am getting an argumentexception for a certain image. I believe it is because it is a jpeg from a scan, so it doesn't have a datetime.
My problem is that even with the call being in a try/catch statement, the error stops the program before it goes to the catch. Is there any way I can prevent this.
try
{
//check for datetakentag if present return datetime taken
string dateTakenTag = null;
dateTakenTag = Encoding.ASCII.GetString(img.GetPropertyItem(DATE_TAKEN_TAG_ID).Value);
}
catch (ArgumentException e)
{
int year = Curr.Year; etc.
}