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

来源:互联网 发布:mac 图标大小不一样 编辑:程序博客网 时间:2024/04/30 03:16

来自: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 readerExifReader reader = new ExifReader(@"C:\temp\testImage.jpg");// Extract the tag data using the ExifTags enumerationDateTime 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