Hi All,
Here is the code that read Date taken from Digital camera for any image type(jpg,png,tiff).
using System.Windows.Media.Imaging;
using System.Io;
public string GetImageDateTaken(string imagePath)
{
string dateTaken = string.Empty;
try
{
FileInfo fileInformation = new FileInfo(imagePath);
FileStream fileStream = new FileStream(fileInformation.FullName, FileMode.Open, FileAccess.Read, FileShare.Read);
System.Windows.Media.Imaging.BitmapSource imgeSource = BitmapFrame.Create(fileStream);
BitmapMetadata imageMetaData = (BitmapMetadata)imgeSource.Metadata;
dateTaken = imageMetaData.DateTaken;
}
catch
{
return dateTaken;
}
return dateTaken;
}