Given a filename, I need to be able to access certain metadata in an image for a (closed source) project I'm currently developing, without regard to how the metadata is stored (that is, Exif, IPTC, or XMP). In particular, I want to access geotagging data.
Is there a way of doing this without requiring any third party assemblies or libraries (i.e. is it doable with stock Microsoft .NET) and how would it be done? Or am I stuck with a lot of P/Invoking of WIC?
Check the FreeImage project - a C++ image loading and processing that has .NET wrapper. perhaps it can do that
Old question, I know, but EXIF can be extracted with just the base .NET framework (no third party DLLs). EXIF items can be extracted from an Image object as PropertyItems. I'm using a method similar to this to extract a particular property as a string (e.g. Date Taken or Maker Note):
public static string GetEXIFInfo(System.Drawing.Image img, int propertyItem) {
return new ASCIIEncoding().GetString(img.GetPropertyItem(propertyItem).Value);
}
And here's a list of propertyitem values you can use to get various EXIF values: http://msdn.microsoft.com/en-us/library/ms534416%28VS.85%29.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With