Image Pic = Image.FromFile(Filename); PropertyItems = Pic.PropertyItems; PropertyItems.Id = 0x0002; //index of the EXIF TAG PropertyItems.Type = 5;// PropertyItems.Len = length; PropertyItems.Value =new byte[length]; Pic.SetPropertyItem(PropertyItems);
And that’s pretty much it, there are a few more tweaks to save the image.
I’m publishing here a small C# file with a static function to perform a simple action to embed GPS latitude, longitude (Which can be taken from the gps log according to time that the picture was taken).
It is pretty much straight forward.
It can be used like so
WriteLongLat(“c:/temp/house_gps.jpg”, 33, 0, 48.46, 35, 5, 38.12);
where the first parameter represents the file name to be embedded and the other parameters represent the lon and lat degrees, minutes, and seconds..
Feel free to use this as will (LGPL) license