Class ExifEntry
One EXIF value: its tag, TIFF type and raw bytes, with accessors that read them as text, integers or fractions.
public sealed class ExifEntry
- Inheritance
-
ExifEntry
- Inherited Members
Examples
if (image.Metadata.Exif is ExifData exif)
{
Console.WriteLine($"{exif.CameraMake} {exif.CameraModel}, {exif.DateTaken}, {exif.Location}");
if (exif.TryGet(ExifKey.ExposureTime, out ExifEntry? exposure))
{
Console.WriteLine($"1/{1 / exposure.AsDouble():0} s");
}
exif.Set(ExifKey.Copyright, "© 2026 Example");
exif.Remove(ExifKey.GpsLatitude);
}
Properties
Count
Gets the number of values (characters, for text).
public int Count { get; }
Property Value
IsBigEndian
Gets whether RawValue is big-endian (Motorola order) rather than little-endian (Intel order).
public bool IsBigEndian { get; }
Property Value
Key
Gets the tag and the IFD it is in.
public ExifKey Key { get; }
Property Value
RawValue
Gets the value bytes as stored, in the block's byte order.
public ReadOnlyMemory<byte> RawValue { get; }
Property Value
Type
Gets the TIFF type.
public ExifType Type { get; }
Property Value
Methods
AsDouble(int)
Returns value index of any numeric type as a double.
public double AsDouble(int index = 0)
Parameters
indexintWhich value, from 0.
Returns
- double
The value.
Exceptions
- InvalidOperationException
The type is text.
- ArgumentOutOfRangeException
indexis not below Count.
AsFraction(int)
Returns value index as a fraction: rationals as stored, integers over 1.
public ExifFraction AsFraction(int index = 0)
Parameters
indexintWhich value, from 0.
Returns
- ExifFraction
The fraction.
Exceptions
- InvalidOperationException
The type is neither rational nor integer.
- ArgumentOutOfRangeException
indexis not below Count.
AsInteger(int)
Returns value index of an integer type.
public long AsInteger(int index = 0)
Parameters
indexintWhich value, from 0.
Returns
- long
The value.
Exceptions
- InvalidOperationException
The type is not an integer type.
- ArgumentOutOfRangeException
indexis not below Count.
AsString()
Returns the value as text. ASCII values up to the first zero byte, read as UTF-8 when they are valid UTF-8 and as Latin-1 otherwise. The Windows XP tags (XPTitle and the others) as UTF-16. The encoded strings (UserComment, GpsProcessingMethod, GpsAreaInformation) by their character-code prefix: ASCII, UNICODE (UTF-16, either byte order), JIS (Shift-JIS when the app registered the code page provider) or undefined.
public string AsString()
Returns
- string
The text.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.