.NET ez 2012-06-20
本篇利用 ExifLibrary v0.16 讀取 圖片 內的 EXIF 資訊。
官方網站下載:http://code.google.com/p/exiflibrary/
本地下載:ExifLibrary_v0.16
讀取 EXIF 資訊範例:
ExifLibrary.ImageFile EXIF_F = ExifLibrary.ImageFile.FromFile("檔案路徑"); foreach (var key in EXIF_F.Properties) { Console.WriteLine(key.Name + "\t" + key.Value.ToString()); }
複製 EXIF 資訊 a 檔案到 b 檔案:
ExifLibrary.ImageFile EXIF_F = ExifLibrary.ImageFile.FromFile("a.jpg"); ExifLibrary.ImageFile EXIF_T = ExifLibrary.ImageFile.FromFile("b.jpg"); EXIF_T.Properties.Clear(); foreach (var key in EXIF_F.Properties) { EXIF_T.Properties.Add(key); } EXIF_T.Save("b.jpg");
標籤: .NET
本文章網址:
https://www.ez2o.com/Blog/Post/csharp-Read-Image-EXIF-ExifLibrary-Sample-Code
https://www.ez2o.com/Blog/Post/234
https://www.ez2o.com/Blog/Post/csharp-Read-Image-EXIF-ExifLibrary-Sample-Code
https://www.ez2o.com/Blog/Post/234