您的位置:首页 > 编程语言 > C#

c#使用ExifLib 提取图像的 EXIF信息

2013-03-07 14:36 330 查看
来自:http://outofmemory.cn/code-snippet/479/c-usage-ExifLib-tiqu-image-EXIF-information

EXIFExchangeable image file format)是可交换图像文件的缩写,是专门为数码相机的照片设定的,可以记录数码照片的属性信息和拍摄数据。

EXIF最初由日本电子工业发展协会在1996年制定,版本为1.0。1998年,升级到2.1,增加了对音频文件的支持。2002年3月,发表了2.2版。

EXIF可以附加于JPEG、TIFF、RIFF等文件之中,为其增加有关数码相机拍摄信息的内容和索引图或图像处理软件的版本信息。

using ExifLib;
...
...
...
// Instantiate the reader
ExifReader reader = new ExifReader(@"C:\temp\testImage.jpg");

// Extract the tag data using the ExifTags enumeration
DateTime datePictureTaken;
if (reader.GetTagValue<DateTime>(ExifTags.DateTimeDigitized,
out datePictureTaken))
{
// Do whatever is required with the extracted information
MessageBox.Show(this, string.Format("The picture was taken on {0}",
datePictureTaken), "Image information", MessageBoxButtons.OK);
}
http://www.codeproject.com/Articles/36342/ExifLib-A-Fast-Exif-Data-Extractor-for-NET-2-0
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: