Skip to main content

Metadata Model

exiftool-ts normalizes tags across all formats into one flat record of TagValues, matching ExifTool's tag names and printed representations.

Tag Record

read() returns a FileInfo:

interface FileInfo {
path: string; // Source path
format: string; // Detected format ("JPEG", "DNG", …)
tags: Record<string, TagValue>; // Flat tag map, ExifTool naming
errors?: string[];
warnings?: string[];
}

type TagValue = string | number | boolean | Uint8Array | null | TagValue[];

There is no nested tag object and no raw/groups fields — one key per tag, ExifTool's name (e.g. ExposureTime, GPSLatitude, ImageSize).

Tag Groups

Groups exist for output formatting (CLI -G[NUM], -g[NUM]) and are resolved from the tag database's group families:

GroupStandardsDescription
EXIF (IFD0, ExifIFD)Exif 2.3+, TIFF/EPCamera settings, image properties
GPSGPS IFDGeolocation data
XMPXMP Core, IPTC Core, Dublin CoreExtensible metadata
IPTCIIM, IPTC CoreNews/photo agency metadata
ICCICC ProfileColor management
JFIFJPEG File Interchange FormatJPEG stream header
CompositeComputedDerived tags
FileFile systemFile properties
MakerNotesVendor-specificCore 6 vendors decoded (Canon, Nikon, Sony, Olympus, Panasonic, Pentax); others keep markers

With -G1 the CLI prefixes tags (EXIF:ExposureTime, Composite:Aperture). The library API returns unprefixed names.

Value Representations

Values mirror what ExifTool prints — exiftool is the ground truth:

KindRepresentationExample
Stringsplain stringMake: "Canon"
Numbersnumber where ExifTool prints oneFNumber: 2.8
PrintConv'd enumsstringOrientation: "Horizontal (normal)"
Rationals/fractionsstringExposureTime: "1/125"
DatesExifTool date string (YYYY:MM:DD HH:MM:SS±HH:MM)ModifyDate: "2024:09:17 21:46:07+02:00"
GPS coordinatesDMS string, or decimal with -c %.6f45 deg 11' 15.24" N
ArraysTagValue[]Keywords: ["nature", "landscape"]
BinaryUint8Array (placeholder string in JSON unless -b)ThumbnailImage

Composite Tags

Computed from multiple source tags (computeCompositeTags), same names and values as ExifTool:

Composite TagSources
ApertureFNumber
ShutterSpeedExposureTime
ImageSizeImageWidth, ImageLength/Height
MegapixelsImageWidth, ImageHeight
GPSPositionGPSLatitude, GPSLongitude
LensID / LensLensModel / makernote lookups (partial vendor coverage)
SubSecCreateDateModifyDate/OffsetTime/SubSecTime
LightValue, DOF, HyperfocalDistance, FocalLength35eflexposure + focal geometry

Accessing Tags

const result = await exiftool.read('photo.jpg');

result.format; // "JPEG"
result.tags['Make']; // "Canon"
result.tags['ExposureTime']; // "1/125"
result.tags['ImageSize']; // "8256x5504"
Object.keys(result.tags); // every tag name

Group-prefixed views are a CLI/output concern (-G1 -j), not part of FileInfo.