Table of Contents

Class ExifEntry

Namespace
Egami.Metadata
Assembly
Egami.dll

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

int

IsBigEndian

Gets whether RawValue is big-endian (Motorola order) rather than little-endian (Intel order).

public bool IsBigEndian { get; }

Property Value

bool

Key

Gets the tag and the IFD it is in.

public ExifKey Key { get; }

Property Value

ExifKey

RawValue

Gets the value bytes as stored, in the block's byte order.

public ReadOnlyMemory<byte> RawValue { get; }

Property Value

ReadOnlyMemory<byte>

Type

Gets the TIFF type.

public ExifType Type { get; }

Property Value

ExifType

Methods

AsDouble(int)

Returns value index of any numeric type as a double.

public double AsDouble(int index = 0)

Parameters

index int

Which value, from 0.

Returns

double

The value.

Exceptions

InvalidOperationException

The type is text.

ArgumentOutOfRangeException

index is not below Count.

AsFraction(int)

Returns value index as a fraction: rationals as stored, integers over 1.

public ExifFraction AsFraction(int index = 0)

Parameters

index int

Which value, from 0.

Returns

ExifFraction

The fraction.

Exceptions

InvalidOperationException

The type is neither rational nor integer.

ArgumentOutOfRangeException

index is not below Count.

AsInteger(int)

Returns value index of an integer type.

public long AsInteger(int index = 0)

Parameters

index int

Which value, from 0.

Returns

long

The value.

Exceptions

InvalidOperationException

The type is not an integer type.

ArgumentOutOfRangeException

index is 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.