Enum ExifIfd
The image file directories (IFDs) an EXIF block holds its tags in.
public enum ExifIfd
Fields
Exif = 1The EXIF sub-IFD: exposure, lens and capture details.
Gps = 2The GPS sub-IFD: where the photo was taken.
Interoperability = 3The interoperability sub-IFD.
Primary = 0IFD0: the main image (camera make and model, orientation, resolution, date).
Thumbnail = 4IFD1: the embedded thumbnail and its tags.
Examples
using Raster photo = Raster.Load("sideways.jpg");
ExifData exif = photo.Metadata.Exif ?? new ExifData();
// Typed values go in with their EXIF type; fractions are exact numerator / denominator pairs.
exif.Set(ExifKey.ExposureTime, new ExifFraction(1, 250));
exif.Set(ExifKey.Artist, "A. Photographer");
if (exif.TryGet(ExifKey.ExposureTime, out ExifEntry? entry) && entry.Type == ExifType.Rational)
{
Console.WriteLine($"Exposure {entry.AsFraction()} s = {entry.AsFraction().ToDouble()} s, in the {entry.Key.Ifd} IFD");
}
if (exif.Location is GeoPosition where)
{
Console.WriteLine($"Taken at {where.Latitude:F5}, {where.Longitude:F5}");
}