以下是Exif交换格式的规范,如果您计划编写自己的库以编辑标签.
http://www.exif.org/specifications.html
这是一个用Perl编写的库,可以满足您的需求,您可以从中学习:
http://www.sno.phy.queensu.ca/~phil/exiftool/
以下是来自The Code Project的 Exif评估的一个不错的.NET库:
http://www.codeproject.com/KB/graphics/exiftagcol.aspx
您可以在没有任何外部库的情况下执
// Create image.
Image image1 = Image.FromFile("c:\\Photo1.jpg");
// Get a PropertyItem from image1. Because PropertyItem does not
// have public constructor, you first need to get existing PropertyItem
PropertyItem propItem = image1.GetPropertyItem(20624);
// Change the ID of the PropertyItem.
propItem.Id = 20625;
// Set the new PropertyItem for image1.
image1.SetPropertyItem(propItem);
// Save the image.
image1.Save("c:\\Photo1.jpg", ImageFormat.Jpg);
Run Code Online (Sandbox Code Playgroud)
您可以在此处找到所有可能的PropertyItem ID(包括exif)的列表.
更新:同意,此方法将在保存时重新编码图像.但我记得另一种方法,在WinXP SP2中,后来添加了新的成像组件--WIC,你可以将它们用于无损写入元数据 - 操作方法:用元数据重新编码JPEG图像.
归档时间: |
|
查看次数: |
16090 次 |
最近记录: |