 .Net 讀取、修改、複製 照片資訊 EXIF 使用 ExifLibrary
 .Net 讀取、修改、複製 照片資訊 EXIF 使用 ExifLibrary   .NET        ez       2012-06-20
本篇利用 ExifLibrary 讀取 圖片 內的 EXIF 資訊。
官方網站下載:http://www.codeproject.com/Articles/43665/ExifLibrary-for-NET
本地下載:ExifLibrary
讀取 EXIF 資訊範例:
ExifLibrary.ExifFile EXIF_T = ExifLibrary.ExifFile.Read("檔案路徑");
foreach (KeyValuePair<ExifLibrary.ExifTag, ExifLibrary.ExifProperty> Item in EXIF_T.Properties)
{
    Console.WriteLine(Item.Key.ToString() + "\t" + Item.Value.ToString());
}複製 EXIF 資訊 a 檔案到 b 檔案:
ExifLibrary.ExifFile EXIF_F = ExifLibrary.ExifFile.Read("a.jpg");
ExifLibrary.ExifFile EXIF_T = ExifLibrary.ExifFile.Read("b.jpg");
foreach (KeyValuePair<ExifLibrary.ExifTag, ExifLibrary.ExifProperty> Item in EXIF_F.Properties)
{
    EXIF_T.Properties.Add(Item.Key, Item.Value);
}
EXIF_T.Save("b.jpg");變更 EXIF 資訊:
ExifLibrary.ExifFile EXIF_T = ExifLibrary.ExifFile.Read("檔案路徑");
foreach (ExifLibrary.ExifTag key in EXIF_T.Properties.Keys)
{
    if (key.ToString() == "MakerNote")
    {
        byte[] b = { 0 };
        EXIF_T.Properties[key].Value = b;
    }
}
EXIF_T.Save("儲存路徑");標籤:   .NET
本文章網址: 
https://www.ez2o.com/Blog/Post/csharp-Read-Image-EXIF-ExifLibrary
https://www.ez2o.com/Blog/Post/210
https://www.ez2o.com/Blog/Post/csharp-Read-Image-EXIF-ExifLibrary
https://www.ez2o.com/Blog/Post/210

